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§
Sourcefn fetch_diff(&self) -> u64
fn fetch_diff(&self) -> u64
Returns diff of current and old value of the counter. Mostly used in process of aggregating per device metrics.