Skip to content

Commit

Permalink
aggregators: refactor, introduce Writer
Browse files Browse the repository at this point in the history
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
axw committed Jul 24, 2023
1 parent a2be42e commit dd43fa4
Show file tree
Hide file tree
Showing 4 changed files with 505 additions and 473 deletions.
Loading

0 comments on commit dd43fa4

Please sign in to comment.