logo
pub trait Reader {
    fn try_for_each(
        &mut self,
        temp_selector: &dyn TemporalitySelector,
        f: &mut dyn FnMut(&Record<'_>)
    ) -> Result<(), MetricsError>; }
Available on crate feature metrics only.
Expand description

Reader allows a controller to access a complete checkpoint of aggregated metrics from the Processor for a single library of metric data. This is passed to the Exporter which may then use ForEach to iterate over the collection of aggregated metrics.

Required Methods

ForEach iterates over aggregated checkpoints for all metrics that were updated during the last collection period. Each aggregated checkpoint returned by the function parameter may return an error.

The TemporalitySelector argument is used to determine whether the Record is computed using Delta or Cumulative aggregation.

ForEach tolerates ErrNoData silently, as this is expected from the Meter implementation. Any other kind of error will immediately halt ForEach and return the error to the caller.

Implementors