private void TryFlush(bool force) { _bufferBuilder.HandleBufferAndReset(); _optionalCountAggregator?.TryFlush(force); _optionalGaugeAggregator?.TryFlush(force); _optionalSetAggregator?.TryFlush(force); }
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); }