public void TryRecycle()
        {
            var measurementAggregator = new MeasurementAggregator(
                new SimpleMetricSeriesConfiguration(restrictToUInt32Values: false),
                dataSeries: null,
                aggregationCycleKind: CycleKind.Custom);

            var accumulatorAggregator = new AccumulatorAggregator(
                new AccumulatorMetricSeriesConfiguration(restrictToUInt32Values: false),
                dataSeries: null,
                aggregationCycleKind: CycleKind.Custom);


            CommonSimpleDataSeriesAggregatorTests.TryRecycle_NonpersistentAggregator(measurementAggregator);
            CommonSimpleDataSeriesAggregatorTests.TryRecycle_PersistentAggregator(accumulatorAggregator);
        }
        public void Reset()
        {
            {
                var aggregator = new MeasurementAggregator(
                    new SimpleMetricSeriesConfiguration(restrictToUInt32Values: false),
                    dataSeries: null,
                    aggregationCycleKind: CycleKind.Custom);

                CommonSimpleDataSeriesAggregatorTests.Reset_NonersistentAggregator(aggregator, aggregateKindMoniker: "Microsoft.Azure.SimpleStatistics");
            }
            {
                var aggregator = new AccumulatorAggregator(
                    new AccumulatorMetricSeriesConfiguration(restrictToUInt32Values: false),
                    dataSeries: null,
                    aggregationCycleKind: CycleKind.Custom);

                CommonSimpleDataSeriesAggregatorTests.Reset_PersistentAggregator(aggregator, aggregateKindMoniker: "Microsoft.Azure.Accumulator");
            }
        }
        public void CompleteAggregation()
        {
            var aggregationManager = new MetricAggregationManager();

            var mesurementConfig  = new SimpleMetricSeriesConfiguration(restrictToUInt32Values: false);
            var measurementMetric = new MetricSeries(aggregationManager, "Cows Sold", null, mesurementConfig);

            var measurementAggregator = new MeasurementAggregator(
                (SimpleMetricSeriesConfiguration)measurementMetric.GetConfiguration(),
                measurementMetric,
                CycleKind.Custom);

            var accumulatorConfig = new AccumulatorMetricSeriesConfiguration(restrictToUInt32Values: false);
            var accumulatorMetric = new MetricSeries(aggregationManager, "Cows Sold", null, accumulatorConfig);

            var accumulatorAggregator = new AccumulatorAggregator(
                (AccumulatorMetricSeriesConfiguration)accumulatorMetric.GetConfiguration(),
                accumulatorMetric,
                CycleKind.Custom);

            CommonSimpleDataSeriesAggregatorTests.CompleteAggregation_NonpersistentAggregator(measurementAggregator);
            CommonSimpleDataSeriesAggregatorTests.CompleteAggregation_PersistentAggregator(accumulatorAggregator);
        }
        /// <summary />
        /// <param name="dataSeries"></param>
        /// <param name="aggregationCycleKind"></param>
        /// <returns></returns>
        public IMetricSeriesAggregator CreateNewAggregator(MetricSeries dataSeries, MetricAggregationCycleKind aggregationCycleKind)
        {
            IMetricSeriesAggregator aggregator = new AccumulatorAggregator(this, dataSeries, aggregationCycleKind);

            return(aggregator);
        }