internal SearchServiceStatistics(SearchServiceCounters counters, SearchServiceLimits limits) { if (counters == null) { throw new ArgumentNullException(nameof(counters)); } if (limits == null) { throw new ArgumentNullException(nameof(limits)); } Counters = counters; Limits = limits; }
internal static SearchServiceCounters DeserializeSearchServiceCounters(JsonElement element) { SearchServiceCounters result = new SearchServiceCounters(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("documentCount")) { result.DocumentCounter = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value); continue; } if (property.NameEquals("indexesCount")) { result.IndexCounter = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value); continue; } if (property.NameEquals("indexersCount")) { result.IndexerCounter = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value); continue; } if (property.NameEquals("dataSourcesCount")) { result.DataSourceCounter = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value); continue; } if (property.NameEquals("storageSize")) { result.StorageSizeCounter = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value); continue; } if (property.NameEquals("synonymMaps")) { result.SynonymMapCounter = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value); continue; } if (property.NameEquals("skillsetCount")) { result.SkillsetCounter = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value); continue; } } return(result); }
internal static SearchServiceStatistics DeserializeSearchServiceStatistics(JsonElement element) { SearchServiceStatistics result = new SearchServiceStatistics(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("counters")) { result.Counters = SearchServiceCounters.DeserializeSearchServiceCounters(property.Value); continue; } if (property.NameEquals("limits")) { result.Limits = SearchServiceLimits.DeserializeSearchServiceLimits(property.Value); continue; } } return(result); }
internal static SearchServiceStatistics DeserializeSearchServiceStatistics(JsonElement element) { SearchServiceCounters counters = default; SearchServiceLimits limits = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("counters")) { counters = SearchServiceCounters.DeserializeSearchServiceCounters(property.Value); continue; } if (property.NameEquals("limits")) { limits = SearchServiceLimits.DeserializeSearchServiceLimits(property.Value); continue; } } return(new SearchServiceStatistics(counters, limits)); }
/// <summary> Initializes a new instance of SearchServiceStatistics. </summary> /// <param name="counters"> Service level resource counters. </param> /// <param name="limits"> Service level general limits. </param> /// <returns> A new SearchServiceStatistics instance for mocking. </returns> public static SearchServiceStatistics SearchServiceStatistics( SearchServiceCounters counters, SearchServiceLimits limits) => new SearchServiceStatistics(counters, limits);