public static string BuildJson(HealthStatus status, Clock clock, bool indented = true) { return new JsonHealthChecks() .AddVersion(Version) .AddTimestamp(Clock.Default) .AddObject(status) .GetJson(indented); }
public static string BuildJson(MetricsData data, IEnumerable<EnvironmentEntry> environment, Clock clock, bool indented = DefaultIndented) { var version = Version.ToString(CultureInfo.InvariantCulture); return JsonMetricsContext.FromContext(data, environment, version) .ToJsonObject() .AsJson(indented); }
public static string BuildJson(MetricsData data, Clock clock, bool indented = DefaultIndented) { var flatData = data.OldFormat(); return new JsonBuilderV1() .AddVersion(Version) .AddTimestamp(Clock.Default) .AddEnvironment() .AddObject(flatData.Gauges) .AddObject(flatData.Counters) .AddObject(flatData.Meters) .AddObject(flatData.Histograms) .AddObject(flatData.Timers) .GetJson(indented); }
public JsonHealthChecks AddTimestamp(Clock clock) { root.Add(new JsonProperty("Timestamp", Clock.FormatTimestamp(clock.UTCDateTime))); return this; }
public JsonFormatter AddTimestamp(Clock clock) { root.Add(new JsonProperty("Timestamp", clock.LocalDateTime.ToString("yyyy-MM-ddTHH:mm:ss.ffffK", CultureInfo.InvariantCulture))); return this; }
public JsonBuilderV1 AddTimestamp(Clock clock) { root.Add(new JsonProperty("Timestamp", Clock.FormatTimestamp(clock.UTCDateTime))); return this; }