Struct prometheus::core::GenericGauge [−][src]
pub struct GenericGauge<P: Atomic> { /* fields omitted */ }
Methods
impl<P: Atomic> GenericGauge<P>
[src]
impl<P: Atomic> GenericGauge<P>
pub fn new<S: Into<String>>(name: S, help: S) -> Result<Self>
[src]
pub fn new<S: Into<String>>(name: S, help: S) -> Result<Self>
Create a GenericGauge
with the name
and help
arguments.
pub fn with_opts(opts: Opts) -> Result<Self>
[src]
pub fn with_opts(opts: Opts) -> Result<Self>
Create a GenericGauge
with the opts
options.
pub fn set(&self, v: P::T)
[src]
pub fn set(&self, v: P::T)
Set the gauge to an arbitrary value.
pub fn inc(&self)
[src]
pub fn inc(&self)
Increase the gauge by 1.
pub fn dec(&self)
[src]
pub fn dec(&self)
Decrease the gauge by 1.
pub fn add(&self, v: P::T)
[src]
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.)
pub fn sub(&self, v: P::T)
[src]
pub fn sub(&self, v: P::T)
Subtract the given value from the gauge. (The value can be negative, resulting in an increment of the gauge.)
pub fn get(&self) -> P::T
[src]
pub fn get(&self) -> P::T
Return the gauge value.
Trait Implementations
impl<P: Atomic> Clone for GenericGauge<P>
[src]
impl<P: Atomic> Clone for GenericGauge<P>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<P: Atomic> Collector for GenericGauge<P>
[src]
impl<P: Atomic> Collector for GenericGauge<P>
fn desc(&self) -> Vec<&Desc>
[src]
fn desc(&self) -> Vec<&Desc>
Return descriptors for metrics.
fn collect(&self) -> Vec<MetricFamily>
[src]
fn collect(&self) -> Vec<MetricFamily>
Collect metrics.
impl<P: Atomic> Metric for GenericGauge<P>
[src]
impl<P: Atomic> Metric for GenericGauge<P>
Auto Trait Implementations
impl<P> Send for GenericGauge<P>
impl<P> Send for GenericGauge<P>
impl<P> Sync for GenericGauge<P>
impl<P> Sync for GenericGauge<P>