Rust

accumulator

Module

[Accumulator]: metrics buffered in memory and written in batches.

Contents

use utopia_usage::Accumulator;
Rust
pub struct Accumulator

Buffers metrics and writes them to a Usage in batches: events with the same tenant, metric and tags are summed (the earliest time wins), gauges keep the last write. It reports how much is buffered and for how long; the caller decides when to Accumulator::flush.