Exemplo n.º 1
0
 private ServiceLoadMetricDescription GetServiceLoadMetricDescription(ArmServiceLoadMetrics metric)
 {
     return(new ServiceLoadMetricDescription()
     {
         Name = metric.Name,
         Weight =
             (ServiceLoadMetricWeight)Enum.Parse(
                 typeof(ServiceLoadMetricWeight),
                 metric.Weight.ToString())
     });
 }
Exemplo n.º 2
0
        private ServiceLoadMetricDescription GetServiceLoadMetricDescription(
            ArmServiceKind serviceKind,
            ArmServiceLoadMetrics metric)
        {
            var weight = (ServiceLoadMetricWeight)Enum.Parse(
                typeof(ServiceLoadMetricWeight),
                metric.Weight.ToString());

            switch (serviceKind)
            {
            case ArmServiceKind.Stateful:
                return(new StatefulServiceLoadMetricDescription(metric.Name, 0, 0, weight));

            case ArmServiceKind.Stateless:
                return(new StatelessServiceLoadMetricDescription(metric.Name, 0, weight));

            default:
                throw new ArgumentOutOfRangeException(
                          nameof(serviceKind),
                          serviceKind,
                          $"{this.TraceType}: Unexpected ArmServiceKind");
            }
        }