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

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<()>

Increments counter by a given offset.

fn value(&self) -> Result<u64>

Returns current value of the counter.

Loading content...

Provided methods

fn inc(&self) -> Result<()>

Increments counter by 1.

Loading content...

Implementors

Loading content...