[][src]Trait vmm_sys_util::metric::Metric

pub trait Metric {
    fn add(&self, value: u64);
fn count(&self) -> u64;
fn reset(&self);
fn set(&self, value: u64); fn inc(&self) { ... } }

Abstraction over the common metric operations.

An object implementing Metric is expected to have an inner counter that can be incremented and reset. The Metric trait can be used for implementing a metric system backend (or an aggregator).

Required methods

fn add(&self, value: u64)

Adds value to the current counter.

fn count(&self) -> u64

Returns current value of the counter.

fn reset(&self)

Resets the metric counter.

fn set(&self, value: u64)

Set the metric counter value.

Loading content...

Provided methods

fn inc(&self)

Increments by 1 unit the current counter.

Loading content...

Implementations on Foreign Types

impl Metric for AtomicU64[src]

fn add(&self, value: u64)[src]

Adds value to the current counter.

According to fetch_add documentation, in case of an integer overflow, the counter starts over from 0.

fn count(&self) -> u64[src]

Returns current value of the counter.

fn reset(&self)[src]

Resets the metric counter to 0.

fn set(&self, value: u64)[src]

Set the metric counter value.

Loading content...

Implementors

Loading content...