Trait envoy_sdk::host::stats::Counter[][src]

pub trait Counter {
    fn add(&self, offset: u64) -> Result<()>;
fn value(&self) -> Result<u64>; fn inc(&self) -> Result<()> { ... } }

An interface of the Envoy Counter.

A Counter can only be incremented.

Examples

Basic usage of Counter:

use envoy::host::Stats;

let stats = Stats::default();

let requests_total = stats.counter("requests_total")?;

requests_total.inc()?;

Required methods

fn add(&self, offset: u64) -> Result<()>[src]

Increments counter by a given offset.

fn value(&self) -> Result<u64>[src]

Returns current value of the counter.

Loading content...

Provided methods

fn inc(&self) -> Result<()>[src]

Increments counter by 1.

Loading content...

Implementations on Foreign Types

impl<T: Counter> Counter for Rc<T>[src]

fn add(&self, offset: u64) -> Result<()>[src]

Increments counter by a given offset.

fn value(&self) -> Result<u64>[src]

Returns current value of the counter.

Loading content...

Implementors

Loading content...