Struct prometrics::metrics::Gauge [] [src]

pub struct Gauge(_);

Gauge is a metric that represents a single numerical value that can arbitrarily go up and down.

Cloned gauges share the same value.

Methods

impl Gauge
[src]

[src]

Makes a new Gauge instance.

Note that it is recommended to create this via GaugeBuilder.

[src]

Returns the name of this gauge.

[src]

Returns the help of this gauge.

[src]

Returns the labels of this gauge.

[src]

Returns the mutable labels of this gauge.

[src]

Returns the timestamp of this gauge.

[src]

Returns the mutable timestamp of this gauge.

[src]

Returns the value of this gauge.

[src]

Increments this gauge.

[src]

Adds count to this gauge.

[src]

Decrements this gauge.

[src]

Subtracts count from this gauge.

[src]

Sets this gauge to value.

[src]

Sets this gauge to the current unixtime in seconds.

[src]

Tracks in-progress processings in some piece of code/function.

Examples

use prometrics::metrics::GaugeBuilder;

let mut gauge0 = GaugeBuilder::new("foo").finish().unwrap();
let gauge1 = gauge0.clone();

assert_eq!(gauge0.value(), 0.0);
gauge0.track_inprogress(|| {
    assert_eq!(gauge1.value(), 1.0);
});
assert_eq!(gauge0.value(), 0.0);

[src]

Measures the exeuction time of f and sets this gauge to its duration in seconds.

[src]

Returns a collector for this gauge.

Trait Implementations

impl From<Gauge> for Metric
[src]

[src]

Performs the conversion.

impl Debug for Gauge
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for Gauge
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Gauge
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Gauge

impl Sync for Gauge