Struct prometheus::core::GenericCounter [−][src]
The underlying implementation for Counter
and IntCounter
.
Implementations
impl<P: Atomic> GenericCounter<P>
[src][−]
pub fn new<S1: Into<String>, S2: Into<String>>(
name: S1,
help: S2
) -> Result<Self>
[src][−]
name: S1,
help: S2
) -> Result<Self>
Create a GenericCounter
with the name
and help
arguments.
pub fn with_opts(opts: Opts) -> Result<Self>
[src][−]
Create a GenericCounter
with the opts
options.
pub fn inc_by(&self, v: P::T)
[src][−]
pub fn inc(&self)
[src][−]
Increase the counter by 1.
pub fn get(&self) -> P::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: Atomic> Clone for GenericCounter<P>
[src][+]
impl<P: Atomic> Collector for GenericCounter<P>
[src][+]
impl<P: Debug + Atomic> Debug for GenericCounter<P>
[src][+]
impl<P: Atomic> Metric for GenericCounter<P>
[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> 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,
impl<T> From<T> for T
[src][+]
impl<T> Instrument for T
[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,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,