Struct prometheus::Untyped
[−]
[src]
pub struct Untyped { // some fields omitted }
Untyped is a Metric that represents a single numerical value that can arbitrarily go up and down.
An Untyped metric works the same as a Gauge. The only difference is that to no type information is implied.
Methods
impl Untyped
[src]
fn new<S: Into<String>>(name: S, help: S) -> Result<Untyped>
new
creates a Untyped
with the name
and help
arguments.
fn with_opts(opts: Opts) -> Result<Untyped>
with_opts
creates a Untyped
with the opts
options.
impl Untyped
[src]
fn set(&self, v: f64)
set
sets the untyped to an arbitrary value.
fn inc(&self)
inc
increments the untyped by 1.
fn dec(&self)
dec
decrements the untyped by 1.
fn add(&self, v: f64)
add
adds the given value to the untyped. (The value can be
negative, resulting in a decrease.)
fn sub(&self, v: f64)
sub
subtracts the given value from the untyped. (The value can be
negative, resulting in an increase.)
fn get(&self) -> f64
get
returns the untyped value.
Trait Implementations
impl Clone for Untyped
[src]
fn clone(&self) -> Untyped
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 Untyped
[src]
fn desc(&self) -> &Desc
desc
returns the descriptor for the metric collector.
fn collect(&self) -> MetricFamily
collect
collects the metric.