Trait micro_kit::metrics::Counter
[−]
[src]
pub trait Counter: Send + Sync { fn clear(&self); fn inc(&self); fn add(&self, value: usize); fn snapshot(&self) -> CounterSnapshot; }
Counter
is a Metric
that represents a single numerical value that can
increases over time.
Required Methods
fn clear(&self)
Clear the counter, setting the value to 0
.
fn inc(&self)
Increment the counter by 1.
fn add(&self, value: usize)
Increment the counter by the given amount. MUST check that v >= 0.
fn snapshot(&self) -> CounterSnapshot
Take a snapshot of the current value for use with a Reporter
.
Implementors
impl Counter for StdCounter