< Summary

Class:Azure.Search.Documents.Indexes.Models.SearchServiceStatistics
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchServiceStatistics.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchServiceStatistics.Serialization.cs
Covered lines:17
Uncovered lines:2
Coverable lines:19
Total lines:74
Line coverage:89.4% (17 of 19)
Covered branches:8
Total branches:10
Branch coverage:80% (8 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-75%50%
get_Counters()-100%100%
get_Limits()-100%100%
DeserializeSearchServiceStatistics(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchServiceStatistics.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9
 10namespace Azure.Search.Documents.Indexes.Models
 11{
 12    /// <summary> Response from a get service statistics request. If successful, it includes service level counters and 
 13    public partial class SearchServiceStatistics
 14    {
 15        /// <summary> Initializes a new instance of SearchServiceStatistics. </summary>
 16        /// <param name="counters"> Service level resource counters. </param>
 17        /// <param name="limits"> Service level general limits. </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="counters"/> or <paramref name="limits"/> is null. <
 619        internal SearchServiceStatistics(SearchServiceCounters counters, SearchServiceLimits limits)
 20        {
 621            if (counters == null)
 22            {
 023                throw new ArgumentNullException(nameof(counters));
 24            }
 625            if (limits == null)
 26            {
 027                throw new ArgumentNullException(nameof(limits));
 28            }
 29
 630            Counters = counters;
 631            Limits = limits;
 632        }
 33
 34        /// <summary> Service level resource counters. </summary>
 2635        public SearchServiceCounters Counters { get; }
 36        /// <summary> Service level general limits. </summary>
 237        public SearchServiceLimits Limits { get; }
 38    }
 39}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchServiceStatistics.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Search.Documents.Indexes.Models
 12{
 13    public partial class SearchServiceStatistics
 14    {
 15        internal static SearchServiceStatistics DeserializeSearchServiceStatistics(JsonElement element)
 16        {
 617            SearchServiceCounters counters = default;
 618            SearchServiceLimits limits = default;
 4819            foreach (var property in element.EnumerateObject())
 20            {
 1821                if (property.NameEquals("counters"))
 22                {
 623                    counters = SearchServiceCounters.DeserializeSearchServiceCounters(property.Value);
 624                    continue;
 25                }
 1226                if (property.NameEquals("limits"))
 27                {
 628                    limits = SearchServiceLimits.DeserializeSearchServiceLimits(property.Value);
 29                    continue;
 30                }
 31            }
 632            return new SearchServiceStatistics(counters, limits);
 33        }
 34    }
 35}