Counter

Trait Counter 

Source
pub trait Counter: Send + Sync {
    // Required methods
    fn clear(&self);
    fn inc(&self);
    fn add(&self, value: usize);
    fn snapshot(&self) -> CounterSnapshot;
}
Expand description

Counter is a Metric that represents a single numerical value that can increases over time.

Required Methods§

Source

fn clear(&self)

Clear the counter, setting the value to 0.

Source

fn inc(&self)

Increment the counter by 1.

Source

fn add(&self, value: usize)

Increment the counter by the given amount. MUST check that v >= 0.

Source

fn snapshot(&self) -> CounterSnapshot

Take a snapshot of the current value for use with a Reporter.

Implementors§