Struct metrix::instruments::Gauge[][src]

pub struct Gauge { /* fields omitted */ }

Simply returns the value that has been observed last.

Reacts to the following Observation:

  • Obervation::ObservedOneValue(Update::ObservationWithValue)

Example

use std::time::Instant;
use metrix::instruments::*;

let mut gauge = Gauge::new_with_defaults("example");
assert_eq!(None, gauge.get());
let update = Update::ObservationWithValue(12, Instant::now());
gauge.update(&update);

assert_eq!(Some(12), gauge.get());

Methods

impl Gauge
[src]

Gets the name of this Gauge

Set the name if this Gauge.

The name is a path segment within a Snapshot

Sets the title of this Gauge.

A title can be part of a descriptive Snapshot

Sets the description of this Gauge.

A description can be part of a descriptive Snapshot

Trait Implementations

impl Instrument for Gauge
[src]

impl PutsSnapshot for Gauge
[src]

Puts the current snapshot values into the given Snapshot thereby following the guidelines of PutsSnapshot. Read more

impl Updates for Gauge
[src]

Update the internal state according to the given Update. Read more

impl Descriptive for Gauge
[src]

Auto Trait Implementations

impl Send for Gauge

impl Sync for Gauge