< Summary

Class:Azure.Search.Documents.Indexes.Models.SearchServiceCounters
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchServiceCounters.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchServiceCounters.Serialization.cs
Covered lines:45
Uncovered lines:6
Coverable lines:51
Total lines:130
Line coverage:88.2% (45 of 51)
Covered branches:20
Total branches:26
Branch coverage:76.9% (20 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-70%50%
get_DocumentCounter()-100%100%
get_IndexCounter()-100%100%
get_IndexerCounter()-100%100%
get_DataSourceCounter()-100%100%
get_StorageSizeCounter()-100%100%
get_SynonymMapCounter()-100%100%
DeserializeSearchServiceCounters(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchServiceCounters.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> Represents service-level resource counters and quotas. </summary>
 13    public partial class SearchServiceCounters
 14    {
 15        /// <summary> Initializes a new instance of SearchServiceCounters. </summary>
 16        /// <param name="documentCounter"> Total number of documents across all indexes in the service. </param>
 17        /// <param name="indexCounter"> Total number of indexes. </param>
 18        /// <param name="indexerCounter"> Total number of indexers. </param>
 19        /// <param name="dataSourceCounter"> Total number of data sources. </param>
 20        /// <param name="storageSizeCounter"> Total size of used storage in bytes. </param>
 21        /// <param name="synonymMapCounter"> Total number of synonym maps. </param>
 22        /// <exception cref="ArgumentNullException"> <paramref name="documentCounter"/>, <paramref name="indexCounter"/>
 623        internal SearchServiceCounters(SearchResourceCounter documentCounter, SearchResourceCounter indexCounter, Search
 24        {
 625            if (documentCounter == null)
 26            {
 027                throw new ArgumentNullException(nameof(documentCounter));
 28            }
 629            if (indexCounter == null)
 30            {
 031                throw new ArgumentNullException(nameof(indexCounter));
 32            }
 633            if (indexerCounter == null)
 34            {
 035                throw new ArgumentNullException(nameof(indexerCounter));
 36            }
 637            if (dataSourceCounter == null)
 38            {
 039                throw new ArgumentNullException(nameof(dataSourceCounter));
 40            }
 641            if (storageSizeCounter == null)
 42            {
 043                throw new ArgumentNullException(nameof(storageSizeCounter));
 44            }
 645            if (synonymMapCounter == null)
 46            {
 047                throw new ArgumentNullException(nameof(synonymMapCounter));
 48            }
 49
 650            DocumentCounter = documentCounter;
 651            IndexCounter = indexCounter;
 652            IndexerCounter = indexerCounter;
 653            DataSourceCounter = dataSourceCounter;
 654            StorageSizeCounter = storageSizeCounter;
 655            SynonymMapCounter = synonymMapCounter;
 656        }
 57
 58        /// <summary> Total number of documents across all indexes in the service. </summary>
 259        public SearchResourceCounter DocumentCounter { get; }
 60        /// <summary> Total number of indexes. </summary>
 1461        public SearchResourceCounter IndexCounter { get; }
 62        /// <summary> Total number of indexers. </summary>
 263        public SearchResourceCounter IndexerCounter { get; }
 64        /// <summary> Total number of data sources. </summary>
 265        public SearchResourceCounter DataSourceCounter { get; }
 66        /// <summary> Total size of used storage in bytes. </summary>
 267        public SearchResourceCounter StorageSizeCounter { get; }
 68        /// <summary> Total number of synonym maps. </summary>
 269        public SearchResourceCounter SynonymMapCounter { get; }
 70    }
 71}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchServiceCounters.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 SearchServiceCounters
 14    {
 15        internal static SearchServiceCounters DeserializeSearchServiceCounters(JsonElement element)
 16        {
 617            SearchResourceCounter documentCount = default;
 618            SearchResourceCounter indexesCount = default;
 619            SearchResourceCounter indexersCount = default;
 620            SearchResourceCounter dataSourcesCount = default;
 621            SearchResourceCounter storageSize = default;
 622            SearchResourceCounter synonymMaps = default;
 8423            foreach (var property in element.EnumerateObject())
 24            {
 3625                if (property.NameEquals("documentCount"))
 26                {
 627                    documentCount = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value);
 628                    continue;
 29                }
 3030                if (property.NameEquals("indexesCount"))
 31                {
 632                    indexesCount = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value);
 633                    continue;
 34                }
 2435                if (property.NameEquals("indexersCount"))
 36                {
 637                    indexersCount = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value);
 638                    continue;
 39                }
 1840                if (property.NameEquals("dataSourcesCount"))
 41                {
 642                    dataSourcesCount = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value);
 643                    continue;
 44                }
 1245                if (property.NameEquals("storageSize"))
 46                {
 647                    storageSize = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value);
 648                    continue;
 49                }
 650                if (property.NameEquals("synonymMaps"))
 51                {
 652                    synonymMaps = SearchResourceCounter.DeserializeSearchResourceCounter(property.Value);
 53                    continue;
 54                }
 55            }
 656            return new SearchServiceCounters(documentCount, indexesCount, indexersCount, dataSourcesCount, storageSize, 
 57        }
 58    }
 59}