예제 #1
0
 private void TryFlush(bool force)
 {
     _bufferBuilder.HandleBufferAndReset();
     _optionalCountAggregator?.TryFlush(force);
     _optionalGaugeAggregator?.TryFlush(force);
     _optionalSetAggregator?.TryFlush(force);
 }
예제 #2
0
        public void OnNewValue()
        {
            var handler    = new BufferBuilderHandlerMock();
            var aggregator = new GaugeAggregator(MetricAggregatorParametersFactory.Create(handler.Object));

            AddStatsMetric(aggregator, "s1", 1);
            AddStatsMetric(aggregator, "s1", 2);
            AddStatsMetric(aggregator, "s2", 3);
            aggregator.TryFlush(force: true);

            Assert.AreEqual("s1:2|g|@0,s2:3|g|@0", handler.Value);
        }