Ejemplo n.º 1
0
        public void CollectTo(IMetricsWriter writer)
        {
            var wrapped = new MetricWriterWrapper(writer);

            foreach (var collector in _enumerableCollectors.Value)
            {
                wrapped.SetCurrentCollector(collector);
                collector.Collect(wrapped);
            }
        }
Ejemplo n.º 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);
            }
        }