зеркало из https://github.com/dotnet/diagnostics.git
dotnet-counters JSON Exporter improvements (#666)
* make timestamp non culture-sensitive, change 'counter type' to 'counterType' * Remove more spaces from the JSON
This commit is contained in:
Родитель
42f505ef91
Коммит
cf73548eeb
|
@ -36,8 +36,8 @@ namespace Microsoft.Diagnostics.Tools.Counters.Exporters
|
|||
}
|
||||
|
||||
builder = new StringBuilder();
|
||||
builder.Append($"{{ \"Target Process\": \"{_processName}\", ");
|
||||
builder.Append($"\"Start Time\": \"{DateTime.Now.ToString()}\", ");
|
||||
builder.Append($"{{ \"TargetProcess\": \"{_processName}\", ");
|
||||
builder.Append($"\"StartTime\": \"{DateTime.Now.ToString()}\", ");
|
||||
builder.Append($"\"Events\": [");
|
||||
}
|
||||
|
||||
|
@ -57,10 +57,10 @@ namespace Microsoft.Diagnostics.Tools.Counters.Exporters
|
|||
File.AppendAllText(_output, builder.ToString());
|
||||
builder.Clear();
|
||||
}
|
||||
builder.Append($"{{ \"timestamp\": \"{DateTime.Now.ToString()}\", ");
|
||||
builder.Append($"{{ \"timestamp\": \"{DateTime.Now.ToString("u")}\", ");
|
||||
builder.Append($" \"provider\": \"{providerName}\", ");
|
||||
builder.Append($" \"name\": \"{payload.GetDisplay()}\", ");
|
||||
builder.Append($" \"counter type\": \"{payload.GetCounterType()}\", ");
|
||||
builder.Append($" \"counterType\": \"{payload.GetCounterType()}\", ");
|
||||
builder.Append($" \"value\": {payload.GetValue()} }},");
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ namespace DotnetCounters.UnitTests
|
|||
[JsonProperty("name")]
|
||||
public string name { get; set; }
|
||||
|
||||
[JsonProperty("counter type")]
|
||||
[JsonProperty("counterType")]
|
||||
public string counterType { get; set; }
|
||||
|
||||
[JsonProperty("value")]
|
||||
|
@ -158,10 +158,10 @@ namespace DotnetCounters.UnitTests
|
|||
|
||||
class JSONCounterTrace
|
||||
{
|
||||
[JsonProperty("Target Process")]
|
||||
[JsonProperty("TargetProcess")]
|
||||
public string targetProcess { get; set; }
|
||||
|
||||
[JsonProperty("Start Time")]
|
||||
[JsonProperty("StartTime")]
|
||||
public string startTime { get; set; }
|
||||
|
||||
[JsonProperty("Events")]
|
||||
|
|
Загрузка…
Ссылка в новой задаче