Type Alias prometheus::local::LocalIntCounter

source ·
pub type LocalIntCounter = GenericLocalCounter<AtomicU64>;
Expand description

The integer version of LocalCounter. Provides better performance are all positive integers (natural numbers).

Aliased Type§

struct LocalIntCounter { /* private fields */ }

Implementations

source§

impl<P: Atomic> GenericLocalCounter<P>

source

pub fn inc_by(&self, v: P::T)

Increase the given value to the local counter.

§Panics

Panics in debug build if the value is < 0.

source

pub fn inc(&self)

Increase the local counter by 1.

source

pub fn get(&self) -> P::T

Return the local counter value.

source

pub fn reset(&self)

Restart the counter, resetting its value back to 0.

source

pub fn flush(&self)

Flush the local metrics to the Counter.

Trait Implementations

source§

impl<P: Atomic> Clone for GenericLocalCounter<P>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<P: Atomic> CounterWithValueType for GenericLocalCounter<P>

§

type ValueType = P

the exact type which implements Atomic
source§

impl<P: Debug + Atomic> Debug for GenericLocalCounter<P>
where P::T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<P: Atomic> LocalMetric for GenericLocalCounter<P>

source§

fn flush(&self)

Flush the local metrics to the Counter.