Type Alias LabelGuardedUintGaugeVec

Source
pub type LabelGuardedUintGaugeVec<const N: usize> = LabelGuardedMetricVec<VecBuilderOfGauge<AtomicU64>, N>;

Aliased Type§

struct LabelGuardedUintGaugeVec<const N: usize> {
    inner: MetricVec<impl MetricVecBuilder<M = GenericGauge<AtomicU64>>>,
    info: Arc<Mutex<RawMutex, LabelGuardedMetricsInfo<N>>>,
    labels: [&'static str; N],
}

Fields§

§inner: MetricVec<impl MetricVecBuilder<M = GenericGauge<AtomicU64>>>§info: Arc<Mutex<RawMutex, LabelGuardedMetricsInfo<N>>>§labels: [&'static str; N]

Implementations

Source§

impl<T: MetricVecBuilder, const N: usize> LabelGuardedMetricVec<T, N>

Source

pub fn new(inner: MetricVec<T>, labels: &[&'static str; N]) -> Self

Source

pub fn with_guarded_label_values( &self, labels: &[&str; N], ) -> LabelGuardedMetric<T::M, N>

This is similar to the with_label_values of the raw metrics vec. We need to pay special attention that, unless for some special purpose, we should not drop the returned LabelGuardedMetric immediately after using it, such as metrics.with_guarded_label_values(...).inc();, because after dropped the label will be regarded as not used any more, and the internal raw metrics will be removed and reset.

Instead, we should store the returned LabelGuardedMetric in a scope with longer lifetime so that the labels can be regarded as being used in its whole life scope. This is also the recommended way to use the raw metrics vec.

Source

pub fn with_test_label(&self) -> LabelGuardedMetric<T::M, N>

Source§

impl<const N: usize> LabelGuardedMetricVec<impl MetricVecBuilder<M = GenericCounter<AtomicU64>>, N>

Source§

impl<const N: usize> LabelGuardedMetricVec<impl MetricVecBuilder<M = GenericGauge<AtomicF64>>, N>

Source

pub fn test_gauge_vec() -> Self

Source§

impl<const N: usize> LabelGuardedMetricVec<impl MetricVecBuilder<M = GenericGauge<AtomicI64>>, N>

Source

pub fn test_int_gauge_vec() -> Self

Source§

impl<const N: usize> LabelGuardedMetricVec<impl MetricVecBuilder<M = Histogram>, N>

Source

pub fn test_histogram_vec() -> Self

Trait Implementations

Source§

impl<T: Clone + MetricVecBuilder, const N: usize> Clone for LabelGuardedMetricVec<T, N>

Source§

fn clone(&self) -> LabelGuardedMetricVec<T, N>

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: MetricVecBuilder, const N: usize> Collector for LabelGuardedMetricVec<T, N>

Source§

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

Return descriptors for metrics.
Source§

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

Collect metrics.
Source§

impl<T: MetricVecBuilder, const N: usize> Debug for LabelGuardedMetricVec<T, N>

Source§

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

Formats the value using the given formatter. Read more