Exemplo n.º 1
0
        public void CreateAggregateUnsafe()
        {
            var aggregationManager = new MetricAggregationManager();
            var seriesConfig       = new MetricSeriesConfigurationForMeasurement(restrictToUInt32Values: true);

            IEnumerable <KeyValuePair <string, string> > setDimensionNamesValues = new KeyValuePair <string, string>[] { new KeyValuePair <string, string>("Dim 1", "DV1"),
                                                                                                                         new KeyValuePair <string, string>("Dim 2", "DV2"),
                                                                                                                         new KeyValuePair <string, string>("Dim 3", "DV3"),
                                                                                                                         new KeyValuePair <string, string>("Dim 2", "DV2a") };

            IEnumerable <KeyValuePair <string, string> > expectedDimensionNamesValues = new KeyValuePair <string, string>[] { new KeyValuePair <string, string>("Dim 1", "DV1"),
                                                                                                                              new KeyValuePair <string, string>("Dim 2", "DV2a"),
                                                                                                                              new KeyValuePair <string, string>("Dim 3", "DV3") };

            var metric = new MetricSeries(
                aggregationManager,
                new MetricIdentifier(String.Empty, "Cows Sold", expectedDimensionNamesValues.Select(nv => nv.Key).ToArray()),
                setDimensionNamesValues,
                seriesConfig);

            var aggregator = new MeasurementAggregator(
                (MetricSeriesConfigurationForMeasurement)metric.GetConfiguration(),
                metric,
                CycleKind.Custom);

            CommonSimpleDataSeriesAggregatorTests.CreateAggregateUnsafe(aggregator, metric, expectedDimensionNamesValues);
        }
        public void CreateAggregateUnsafe()
        {
            var aggregationManager = new MetricAggregationManager();
            var seriesConfig       = new SimpleMetricSeriesConfiguration(restrictToUInt32Values: false);

            IEnumerable <KeyValuePair <string, string> > setDimensionNamesValues = new KeyValuePair <string, string>[] { new KeyValuePair <string, string>("Dim 1", "DV1"),
                                                                                                                         new KeyValuePair <string, string>("Dim 2", "DV2"),
                                                                                                                         new KeyValuePair <string, string>("Dim 3", "DV3"),
                                                                                                                         new KeyValuePair <string, string>("Dim 2", "DV2a") };

            IEnumerable <KeyValuePair <string, string> > expectedDimensionNamesValues = new KeyValuePair <string, string>[] { new KeyValuePair <string, string>("Dim 1", "DV1"),
                                                                                                                              new KeyValuePair <string, string>("Dim 2", "DV2a"),
                                                                                                                              new KeyValuePair <string, string>("Dim 3", "DV3") };

            var metric = new MetricSeries(aggregationManager, "Cows Sold", setDimensionNamesValues, seriesConfig);

            var aggregator = new MeasurementAggregator(
                (SimpleMetricSeriesConfiguration)metric.GetConfiguration(),
                metric,
                CycleKind.Custom);

            CommonSimpleDataSeriesAggregatorTests.CreateAggregateUnsafe(aggregator, metric, expectedDimensionNamesValues);
        }