Exemple #1
0
        public void CollectTo(IMetricsWriter writer)
        {
            var wrapped = new MetricWriterWrapper(writer);

            foreach (var collector in _enumerableCollectors.Value)
            {
                wrapped.SetCurrentCollector(collector);
                collector.Collect(wrapped);
            }
        }
Exemple #2
0
        public async Task CollectToAsync(IMetricsWriter writer)
        {
            var wrapped = new MetricWriterWrapper(writer);

            foreach (var collector in _enumerableCollectors.Value)
            {
                wrapped.SetCurrentCollector(collector);
                collector.Collect(wrapped);
                await writer.FlushAsync().ConfigureAwait(false);
            }
        }