IncMetric

Trait IncMetric 

Source
pub trait IncMetric {
    // Required methods
    fn add(&self, value: u64);
    fn count(&self) -> u64;
    fn fetch_diff(&self) -> u64;

    // Provided method
    fn inc(&self) { ... }
}
Expand description

Used for defining new types of metrics that act as a counter (i.e they are continuously updated by incrementing their value).

Required Methods§

Source

fn add(&self, value: u64)

Adds value to the current counter.

Source

fn count(&self) -> u64

Returns current value of the counter.

Source

fn fetch_diff(&self) -> u64

Returns diff of current and old value of the counter. Mostly used in process of aggregating per device metrics.

Provided Methods§

Source

fn inc(&self)

Increments by 1 unit the current counter.

Implementors§