< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.NotebookSessionProperties
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookSessionProperties.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookSessionProperties.Serialization.cs
Covered lines:30
Uncovered lines:20
Coverable lines:50
Total lines:120
Line coverage:60% (30 of 50)
Covered branches:14
Total branches:16
Branch coverage:87.5% (14 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-81.82%50%
get_DriverMemory()-0%100%
get_DriverCores()-0%100%
get_ExecutorMemory()-0%100%
get_ExecutorCores()-0%100%
get_NumExecutors()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeNotebookSessionProperties(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookSessionProperties.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.Analytics.Synapse.Artifacts.Models
 11{
 12    /// <summary> Session properties. </summary>
 13    public partial class NotebookSessionProperties
 14    {
 15        /// <summary> Initializes a new instance of NotebookSessionProperties. </summary>
 16        /// <param name="driverMemory"> Amount of memory to use for the driver process. </param>
 17        /// <param name="driverCores"> Number of cores to use for the driver. </param>
 18        /// <param name="executorMemory"> Amount of memory to use per executor process. </param>
 19        /// <param name="executorCores"> Number of cores to use for each executor. </param>
 20        /// <param name="numExecutors"> Number of executors to launch for this session. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="driverMemory"/> or <paramref name="executorMemory"/
 2422        public NotebookSessionProperties(string driverMemory, int driverCores, string executorMemory, int executorCores,
 23        {
 2424            if (driverMemory == null)
 25            {
 026                throw new ArgumentNullException(nameof(driverMemory));
 27            }
 2428            if (executorMemory == null)
 29            {
 030                throw new ArgumentNullException(nameof(executorMemory));
 31            }
 32
 2433            DriverMemory = driverMemory;
 2434            DriverCores = driverCores;
 2435            ExecutorMemory = executorMemory;
 2436            ExecutorCores = executorCores;
 2437            NumExecutors = numExecutors;
 2438        }
 39
 40        /// <summary> Amount of memory to use for the driver process. </summary>
 041        public string DriverMemory { get; set; }
 42        /// <summary> Number of cores to use for the driver. </summary>
 043        public int DriverCores { get; set; }
 44        /// <summary> Amount of memory to use per executor process. </summary>
 045        public string ExecutorMemory { get; set; }
 46        /// <summary> Number of cores to use for each executor. </summary>
 047        public int ExecutorCores { get; set; }
 48        /// <summary> Number of executors to launch for this session. </summary>
 049        public int NumExecutors { get; set; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookSessionProperties.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.Analytics.Synapse.Artifacts.Models
 12{
 13    public partial class NotebookSessionProperties : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("driverMemory");
 019            writer.WriteStringValue(DriverMemory);
 020            writer.WritePropertyName("driverCores");
 021            writer.WriteNumberValue(DriverCores);
 022            writer.WritePropertyName("executorMemory");
 023            writer.WriteStringValue(ExecutorMemory);
 024            writer.WritePropertyName("executorCores");
 025            writer.WriteNumberValue(ExecutorCores);
 026            writer.WritePropertyName("numExecutors");
 027            writer.WriteNumberValue(NumExecutors);
 028            writer.WriteEndObject();
 029        }
 30
 31        internal static NotebookSessionProperties DeserializeNotebookSessionProperties(JsonElement element)
 32        {
 2433            string driverMemory = default;
 2434            int driverCores = default;
 2435            string executorMemory = default;
 2436            int executorCores = default;
 2437            int numExecutors = default;
 28838            foreach (var property in element.EnumerateObject())
 39            {
 12040                if (property.NameEquals("driverMemory"))
 41                {
 2442                    driverMemory = property.Value.GetString();
 2443                    continue;
 44                }
 9645                if (property.NameEquals("driverCores"))
 46                {
 2447                    driverCores = property.Value.GetInt32();
 2448                    continue;
 49                }
 7250                if (property.NameEquals("executorMemory"))
 51                {
 2452                    executorMemory = property.Value.GetString();
 2453                    continue;
 54                }
 4855                if (property.NameEquals("executorCores"))
 56                {
 2457                    executorCores = property.Value.GetInt32();
 2458                    continue;
 59                }
 2460                if (property.NameEquals("numExecutors"))
 61                {
 2462                    numExecutors = property.Value.GetInt32();
 63                    continue;
 64                }
 65            }
 2466            return new NotebookSessionProperties(driverMemory, driverCores, executorMemory, executorCores, numExecutors)
 67        }
 68    }
 69}