Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aggregators: refactor, introduce Writer
Introduce a Writer type, which encapsulates a pebble.Batch and has methods for writing metrics to the batch. Splitting this out of the Aggregator type enables clients to create independent Writers which are bound to an execution context, to naturally avoid lock contention. Replace Aggregator.Stop with Aggregator.Close, which should always be called, even if periodic harvesting is never started. Replace Aggregator.Run with Aggregator.StartHarvesting, which starts the harvest loop in the background with no context; it will be stopped by Aggregator.Close. Move cachedEventsMap to its own file.
- Loading branch information