Struct substrate_prometheus_endpoint::Counter [−][src]
pub struct Counter<P> where
P: Atomic, { /* fields omitted */ }The underlying implementation for Counter and IntCounter.
Implementations
impl<P> GenericCounter<P> where
P: Atomic, [src]
impl<P> GenericCounter<P> where
P: Atomic, [src]pub fn new<S1, S2>(name: S1, help: S2) -> Result<GenericCounter<P>, Error> where
S1: Into<String>,
S2: Into<String>, [src]
S1: Into<String>,
S2: Into<String>,
Create a GenericCounter with the name and help arguments.
pub fn with_opts(opts: Opts) -> Result<GenericCounter<P>, Error>[src]
Create a GenericCounter with the opts options.
pub fn inc_by(&self, v: <P as Atomic>::T)[src]
pub fn inc(&self)[src]
Increase the counter by 1.
pub fn get(&self) -> <P as Atomic>::T[src]
Return the counter value.
pub fn reset(&self)[src]
Restart the counter, resetting its value back to 0.
pub fn local(&self) -> GenericLocalCounter<P>[src]
Return a GenericLocalCounter for single thread usage.
Trait Implementations
impl<P> Clone for GenericCounter<P> where
P: Atomic, [src]
impl<P> Clone for GenericCounter<P> where
P: Atomic, [src]pub fn clone(&self) -> GenericCounter<P>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<P> Collector for GenericCounter<P> where
P: Atomic, [src]
impl<P> Collector for GenericCounter<P> where
P: Atomic, [src]impl<P> Debug for GenericCounter<P> where
P: Debug + Atomic, [src]
impl<P> Debug for GenericCounter<P> where
P: Debug + Atomic, [src]Auto Trait Implementations
impl<P> RefUnwindSafe for GenericCounter<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> Send for GenericCounter<P>
impl<P> Sync for GenericCounter<P>
impl<P> Unpin for GenericCounter<P>
impl<P> UnwindSafe for GenericCounter<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
Blanket Implementations
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> WithSubscriber for T[src]
impl<T> WithSubscriber for T[src]pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>, [src]
S: Into<Dispatch>,