Struct prometheus::Gauge
[−]
[src]
pub struct Gauge { /* fields omitted */ }
Gauge
is a Metric that represents a single numerical value that can
arbitrarily go up and down.
Methods
impl Gauge
[src]
fn new<S: Into<String>>(name: S, help: S) -> Result<Gauge>
new
create a Guage
with the name
and help
arguments.
fn with_opts(opts: Opts) -> Result<Gauge>
with_opts
create a Guage
with the opts
options.
impl Gauge
[src]
fn set(&self, v: f64)
set
sets the gauge to an arbitrary value.
fn inc(&self)
inc
increments the gauge by 1.
fn dec(&self)
dec
decrements the gauge by 1.
fn add(&self, v: f64)
add
adds the given value to the gauge. (The value can be
negative, resulting in a decrease of the gauge.)
fn sub(&self, v: f64)
sub
subtracts the given value from the gauge. (The value can be
negative, resulting in an increase of the gauge.)
fn get(&self) -> f64
get
returns the gauge value.
Trait Implementations
impl Clone for Gauge
[src]
fn clone(&self) -> Gauge
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