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);
            }

            await writer.CloseWriterAsync().ConfigureAwait(false);
        }
 public Task CloseWriterAsync()
 {
     return(_baseWriter.CloseWriterAsync());
 }