Struct substrate_prometheus_endpoint::Counter [−][src]
The underlying implementation for Counter
and IntCounter
.
Implementations
impl<P> GenericCounter<P> where
P: Atomic,
[src]
P: Atomic,
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]
P: Atomic,
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]
P: Atomic,
pub fn desc(&self) -> Vec<&Desc, Global>
[src]
pub fn collect(&self) -> Vec<MetricFamily, Global>
[src]
impl<P> Debug for GenericCounter<P> where
P: Atomic + Debug,
[src]
P: Atomic + Debug,
impl<P> Metric for GenericCounter<P> where
P: Atomic,
[src]
P: Atomic,
Auto Trait Implementations
impl<P> RefUnwindSafe for GenericCounter<P> where
P: RefUnwindSafe,
[src]
P: RefUnwindSafe,
impl<P> Send for GenericCounter<P>
[src]
impl<P> Sync for GenericCounter<P>
[src]
impl<P> Unpin for GenericCounter<P>
[src]
impl<P> UnwindSafe for GenericCounter<P> where
P: RefUnwindSafe,
[src]
P: 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> From<T> 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]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,