Struct prometheus::core::GenericCounter
[−]
[src]
pub struct GenericCounter<P: Atomic> { /* fields omitted */ }
The underlying implementation for Counter
and IntCounter
.
Methods
impl<P: Atomic> GenericCounter<P>
[src]
pub fn new<S: Into<String>>(name: S, help: S) -> Result<Self>
[src]
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 local(&self) -> GenericLocalCounter<P>
[src]
Return a GenericLocalCounter
for single thread usage.
Trait Implementations
impl<P: Atomic> Clone for GenericCounter<P>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<P: Atomic> Collector for GenericCounter<P>
[src]
fn desc(&self) -> Vec<&Desc>
[src]
Return descriptors for metrics.
fn collect(&self) -> Vec<MetricFamily>
[src]
Collect metrics.