internal ServiceStatistics(ServiceCounters counters, ServiceLimits limits) { if (counters == null) { throw new ArgumentNullException(nameof(counters)); } if (limits == null) { throw new ArgumentNullException(nameof(limits)); } Counters = counters; Limits = limits; }
internal static ServiceStatistics DeserializeServiceStatistics(JsonElement element) { ServiceCounters counters = default; ServiceLimits limits = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("counters")) { counters = ServiceCounters.DeserializeServiceCounters(property.Value); continue; } if (property.NameEquals("limits")) { limits = ServiceLimits.DeserializeServiceLimits(property.Value); continue; } } return(new ServiceStatistics(counters, limits)); }