pub type Counter = GenericCounter<AtomicF64>;
Available on crate feature
metrics
only.Expand description
A Metric
represents a single numerical value that only ever goes up.
Aliased Type§
struct Counter { /* private fields */ }
Implementations
Source§impl<P> GenericCounter<P>where
P: Atomic,
impl<P> GenericCounter<P>where
P: Atomic,
Sourcepub fn new<S1, S2>(name: S1, help: S2) -> Result<GenericCounter<P>, Error>
pub fn new<S1, S2>(name: S1, help: S2) -> Result<GenericCounter<P>, Error>
Create a GenericCounter
with the name
and help
arguments.
Sourcepub fn with_opts(opts: Opts) -> Result<GenericCounter<P>, Error>
pub fn with_opts(opts: Opts) -> Result<GenericCounter<P>, Error>
Create a GenericCounter
with the opts
options.
Sourcepub fn local(&self) -> GenericLocalCounter<P>
pub fn local(&self) -> GenericLocalCounter<P>
Return a GenericLocalCounter
for single thread usage.
Trait Implementations§
Source§impl<P> Clone for GenericCounter<P>where
P: Atomic,
impl<P> Clone for GenericCounter<P>where
P: Atomic,
Source§fn clone(&self) -> GenericCounter<P>
fn clone(&self) -> GenericCounter<P>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<P> Collector for GenericCounter<P>where
P: Atomic,
impl<P> Collector for GenericCounter<P>where
P: Atomic,
Source§impl<P> Debug for GenericCounter<P>
impl<P> Debug for GenericCounter<P>
Source§impl<T> MakeCollector for GenericCounter<T>where
T: Atomic + 'static,
impl<T> MakeCollector for GenericCounter<T>where
T: Atomic + 'static,
Source§fn make_collector(mk_opts: MakeCollectorOpts) -> Self
fn make_collector(mk_opts: MakeCollectorOpts) -> Self
Creates a new collector.