示例#1
0
        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;
        }
示例#2
0
        internal static SearchServiceLimits DeserializeSearchServiceLimits(JsonElement element)
        {
            SearchServiceLimits result = new SearchServiceLimits();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("maxFieldsPerIndex"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.MaxFieldsPerIndex = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("maxFieldNestingDepthPerIndex"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.MaxFieldNestingDepthPerIndex = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("maxComplexCollectionFieldsPerIndex"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.MaxComplexCollectionFieldsPerIndex = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("maxComplexObjectsInCollectionsPerDocument"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.MaxComplexObjectsInCollectionsPerDocument = property.Value.GetInt32();
                    continue;
                }
            }
            return(result);
        }
示例#3
0
        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);
        }
示例#4
0
        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);