Type Alias ComputedGauge

Source
pub type ComputedGauge = ComputedGenericGauge<AtomicF64>;
Available on crate feature metrics only.
Expand description

A ComputedGenericGauge for 64-bit floating point numbers.

Aliased Type§

struct ComputedGauge {
    gauge: GenericGauge<AtomicF64>,
    f: Arc<dyn Fn() -> f64 + Send + Sync>,
}

Fields§

§gauge: GenericGauge<AtomicF64>§f: Arc<dyn Fn() -> f64 + Send + Sync>

Implementations

Source§

impl<P> ComputedGenericGauge<P>
where P: Atomic,

Source

pub fn get(&self) -> P::T

Computes the current value of the gauge.

Trait Implementations

Source§

impl<P> Clone for ComputedGenericGauge<P>
where P: Atomic,

Source§

fn clone(&self) -> ComputedGenericGauge<P>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Collector for ComputedGenericGauge<T>
where T: Atomic,

Source§

fn desc(&self) -> Vec<&Desc>

Return descriptors for metrics.
Source§

fn collect(&self) -> Vec<MetricFamily>

Collect metrics.
Source§

impl<P> Debug for ComputedGenericGauge<P>
where P: Atomic + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more