Struct open_metrics_client::metrics::counter::Counter[][src]

pub struct Counter<A> { /* fields omitted */ }

Open Metrics Counter to measure discrete events.

Single monotonically increasing value metric.

let counter = Counter::<AtomicU64>::new();
counter.inc();

Implementations

impl<A: Atomic> Counter<A>[src]

pub fn new() -> Self[src]

pub fn inc(&self) -> A::Number[src]

pub fn inc_by(&self, v: A::Number) -> A::Number[src]

pub fn get(&self) -> A::Number[src]

pub fn inner(&self) -> &A[src]

Exposes the inner atomic type.

This should only be used for advanced use-cases which are not directly supported by the library.

The caller of this function has to uphold the property of an Open Metrics counter namely that the value is monotonically increasing, i.e. either stays the same or increases.

Trait Implementations

impl<A> Clone for Counter<A>[src]

impl<A> Default for Counter<A> where
    A: Default
[src]

impl<A> EncodeMetric for Counter<A> where
    A: Atomic,
    <A as Atomic>::Number: Encode
[src]

impl<A> TypedMetric for Counter<A>[src]

Auto Trait Implementations

impl<A> RefUnwindSafe for Counter<A> where
    A: RefUnwindSafe
[src]

impl<A> Send for Counter<A> where
    A: Send + Sync
[src]

impl<A> Sync for Counter<A> where
    A: Send + Sync
[src]

impl<A> Unpin for Counter<A>[src]

impl<A> UnwindSafe for Counter<A> where
    A: RefUnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendEncodeMetric for T where
    T: EncodeMetric + Send
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.