Пример #1
0
        MetricDirective CreateMetricDirective()
        {
            MetricDirective newMetricDirective = new MetricDirective();

            CloudWatchMetrics.Add(newMetricDirective);
            return(newMetricDirective);
        }
Пример #2
0
 public MetricsContext(RootNode rootNode)
 {
     if (rootNode == null)
     {
         throw new ArgumentNullException(nameof(rootNode));
     }
     _rootNode        = rootNode;
     _metricDirective = rootNode.AWS.MetricDirective;
 }
        internal MetricDirective DeepCloneWithNewMetrics(List <MetricDefinition> metrics)
        {
            var clone = new MetricDirective();

            clone.CustomDimensionSets = new List <DimensionSet>();
            foreach (var dimension in CustomDimensionSets)
            {
                clone.CustomDimensionSets.Add(dimension.DeepClone());
            }

            clone.DefaultDimensionSet           = DefaultDimensionSet.DeepClone();
            clone.Namespace                     = Namespace;
            clone._shouldUseDefaultDimensionSet = _shouldUseDefaultDimensionSet;
            foreach (var metric in metrics)
            {
                clone._metrics.Add(metric);
            }

            return(clone);
        }