Trait MetricsConsumer

Source
pub trait MetricsConsumer {
    type Metric;

    // Required methods
    fn new(client: Client) -> Self;
    fn accept(&mut self, metric: Self::Metric);
    fn flush(&mut self) -> impl Future<Output = ()> + Send;
}
Expand description

Aggregator for metrics. An aggregator should collect metrics so they can be batch dispatched.

Required Associated Types§

Source

type Metric

The metrics type.

Required Methods§

Source

fn new(client: Client) -> Self

Create a new instance for the given client.

Source

fn accept(&mut self, metric: Self::Metric)

Consume a metric.

Source

fn flush(&mut self) -> impl Future<Output = ()> + Send

Flush all consumed metrics to the database.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§