Type Alias prometheus::Gauge
source · pub type Gauge = GenericGauge<AtomicF64>;
Expand description
A Metric
represents a single numerical value that can arbitrarily go up
and down.
Aliased Type§
struct Gauge { /* private fields */ }
Implementations
source§impl<P: Atomic> GenericGauge<P>
impl<P: Atomic> GenericGauge<P>
sourcepub fn new<S1: Into<String>, S2: Into<String>>(
name: S1,
help: S2,
) -> Result<Self>
pub fn new<S1: Into<String>, S2: Into<String>>( name: S1, help: S2, ) -> Result<Self>
Create a GenericGauge
with the name
and help
arguments.
sourcepub fn with_opts(opts: Opts) -> Result<Self>
pub fn with_opts(opts: Opts) -> Result<Self>
Create a GenericGauge
with the opts
options.
sourcepub fn add(&self, v: P::T)
pub fn add(&self, v: P::T)
Add the given value to the gauge. (The value can be negative, resulting in a decrement of the gauge.)