Struct open_metrics_client::metrics::counter::Counter [−][src]
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]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<A> Default for Counter<A> where
A: Default,
[src]
A: Default,
impl<A> EncodeMetric for Counter<A> where
A: Atomic,
<A as Atomic>::Number: Encode,
[src]
A: Atomic,
<A as Atomic>::Number: Encode,
fn encode(&self, encoder: Encoder<'_, '_>) -> Result<(), Error>
[src]
fn metric_type(&self) -> MetricType
[src]
impl<A> TypedMetric for Counter<A>
[src]
const TYPE: MetricType
[src]
Auto Trait Implementations
impl<A> RefUnwindSafe for Counter<A> where
A: RefUnwindSafe,
[src]
A: RefUnwindSafe,
impl<A> Send for Counter<A> where
A: Send + Sync,
[src]
A: Send + Sync,
impl<A> Sync for Counter<A> where
A: Send + Sync,
[src]
A: Send + Sync,
impl<A> Unpin for Counter<A>
[src]
impl<A> UnwindSafe for Counter<A> where
A: RefUnwindSafe,
[src]
A: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T> SendEncodeMetric for T where
T: EncodeMetric + Send,
[src]
T: EncodeMetric + Send,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,