Struct prometheus::Counter
[−]
[src]
pub struct Counter { // some fields omitted }
Counter
is a Metric that represents a single numerical value that only ever
goes up.
Methods
impl Counter
[src]
fn new<S: Into<String>>(name: S, help: S) -> Result<Counter>
new
creates a Counter
with the name
and help
arguments.
fn with_opts(opts: Opts) -> Result<Counter>
with_opts
creates a Counter
with the opts
options.
fn inc_by(&self, v: f64) -> Result<()>
inc_by
increments the given value to the counter. Error if the value is <
0.
fn inc(&self)
inc
increments the counter by 1.
fn get(&self) -> f64
get
returns the counter value.
Trait Implementations
impl Clone for Counter
[src]
fn clone(&self) -> Counter
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Collector for Counter
[src]
fn desc(&self) -> &Desc
desc
returns the descriptor for the metric collector.
fn collect(&self) -> MetricFamily
collect
collects the metric.