< Summary

Class:Azure.Data.Tables.Models.TableMetrics
Assembly:Azure.Data.Tables
File(s):C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableMetrics.cs
C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableMetrics.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\TableMetrics.cs
Covered lines:40
Uncovered lines:3
Coverable lines:43
Total lines:120
Line coverage:93% (40 of 43)
Covered branches:15
Total branches:16
Branch coverage:93.7% (15 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_IncludeApis()-100%100%
.ctor(...)-0%100%
.ctor(...)-100%100%
get_Version()-100%100%
get_Enabled()-100%100%
get_RetentionPolicy()-100%100%
Azure.Core.IXmlSerializable.Write(...)-100%87.5%
DeserializeTableMetrics(...)-100%100%
get_IncludeApis()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableMetrics.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
 8namespace Azure.Data.Tables.Models
 9{
 10    /// <summary> The Metrics. </summary>
 11    public partial class TableMetrics
 3812    {
 13        /// <summary> Initializes a new instance of TableMetrics. </summary>
 14        /// <param name="enabled"> Indicates whether metrics are enabled for the Table service. </param>
 015        public TableMetrics(bool enabled)
 16        {
 017            Enabled = enabled;
 018        }
 19
 20        /// <summary> Initializes a new instance of TableMetrics. </summary>
 21        /// <param name="version"> The version of Analytics to configure. </param>
 22        /// <param name="enabled"> Indicates whether metrics are enabled for the Table service. </param>
 23        /// <param name="includeApis"> Indicates whether metrics should generate summary statistics for called API opera
 24        /// <param name="retentionPolicy"> The retention policy. </param>
 4825        internal TableMetrics(string version, bool enabled, bool? includeApis, RetentionPolicy retentionPolicy)
 26        {
 4827            Version = version;
 4828            Enabled = enabled;
 4829            IncludeApis = includeApis;
 4830            RetentionPolicy = retentionPolicy;
 4831        }
 32
 33        /// <summary> The version of Analytics to configure. </summary>
 8034        public string Version { get; set; }
 35        /// <summary> Indicates whether metrics are enabled for the Table service. </summary>
 7236        public bool Enabled { get; set; }
 37        /// <summary> The retention policy. </summary>
 9638        public RetentionPolicy RetentionPolicy { get; set; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableMetrics.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.Xml;
 9using System.Xml.Linq;
 10using Azure.Core;
 11
 12namespace Azure.Data.Tables.Models
 13{
 14    public partial class TableMetrics : IXmlSerializable
 15    {
 16        void IXmlSerializable.Write(XmlWriter writer, string nameHint)
 17        {
 818            writer.WriteStartElement(nameHint ?? "Metrics");
 819            if (Optional.IsDefined(Version))
 20            {
 821                writer.WriteStartElement("Version");
 822                writer.WriteValue(Version);
 823                writer.WriteEndElement();
 24            }
 825            writer.WriteStartElement("Enabled");
 826            writer.WriteValue(Enabled);
 827            writer.WriteEndElement();
 828            if (Optional.IsDefined(IncludeApis))
 29            {
 430                writer.WriteStartElement("IncludeAPIs");
 431                writer.WriteValue(IncludeApis.Value);
 432                writer.WriteEndElement();
 33            }
 834            if (Optional.IsDefined(RetentionPolicy))
 35            {
 836                writer.WriteObjectValue(RetentionPolicy, "RetentionPolicy");
 37            }
 838            writer.WriteEndElement();
 839        }
 40
 41        internal static TableMetrics DeserializeTableMetrics(XElement element)
 42        {
 4843            string version = default;
 4844            bool enabled = default;
 4845            bool? includeApis = default;
 4846            RetentionPolicy retentionPolicy = default;
 4847            if (element.Element("Version") is XElement versionElement)
 48            {
 4849                version = (string)versionElement;
 50            }
 4851            if (element.Element("Enabled") is XElement enabledElement)
 52            {
 4853                enabled = (bool)enabledElement;
 54            }
 4855            if (element.Element("IncludeAPIs") is XElement includeAPIsElement)
 56            {
 2457                includeApis = (bool?)includeAPIsElement;
 58            }
 4859            if (element.Element("RetentionPolicy") is XElement retentionPolicyElement)
 60            {
 4861                retentionPolicy = RetentionPolicy.DeserializeRetentionPolicy(retentionPolicyElement);
 62            }
 4863            return new TableMetrics(version, enabled, includeApis, retentionPolicy);
 64        }
 65    }
 66}

C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\TableMetrics.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3using Azure.Core;
 4
 5namespace Azure.Data.Tables.Models
 6{
 7    [CodeGenModel("Metrics")]
 8    public partial class TableMetrics
 9    {
 10        /// <summary> Indicates whether metrics should generate summary statistics for called API operations. </summary>
 11        [CodeGenMember("IncludeAPIs")]
 3812        public bool? IncludeApis { get; set; }
 13    }
 14}