Trait goodmetrics::pipeline::AggregationBatcher

source ·
pub trait AggregationBatcher {
    type TBatch;

    // Required method
    fn batch_aggregations(
        &mut self,
        now: SystemTime,
        covered_time: Duration,
        aggregations: &mut AggregatedMetricsMap,
    ) -> Self::TBatch;
}
Expand description

A batcher for aggregated metrics.

You should usually drain the aggregations in the map. If they are not reset, the expectations of downstream senders might not match your implementation. If you have your own sender, this might make sense for you.

Required Associated Types§

source

type TBatch

Type of batch this batcher produces.

Required Methods§

source

fn batch_aggregations( &mut self, now: SystemTime, covered_time: Duration, aggregations: &mut AggregatedMetricsMap, ) -> Self::TBatch

Drain the aggregations into a batch.

Implementors§