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§
Required Methods§
sourcefn batch_aggregations(
&mut self,
now: SystemTime,
covered_time: Duration,
aggregations: &mut AggregatedMetricsMap,
) -> Self::TBatch
fn batch_aggregations( &mut self, now: SystemTime, covered_time: Duration, aggregations: &mut AggregatedMetricsMap, ) -> Self::TBatch
Drain the aggregations into a batch.