Trait mz_ore::metrics::CounterVecExt

source ·
pub trait CounterVecExt {
    type CounterType: Atomic;

    // Required method
    fn get_delete_on_drop_counter<'a, L: PromLabelsExt<'a>>(
        &self,
        labels: L
    ) -> DeleteOnDropCounter<'a, Self::CounterType, L>;
}
Available on crate feature metrics only.
Expand description

Extension trait for all gauge metrics vectors.

It adds a method to create a concrete metric from the vector that gets removed from the vector when the concrete metric is dropped.

Required Associated Types§

source

type CounterType: Atomic

The type of value that the counter should count.

Required Methods§

source

fn get_delete_on_drop_counter<'a, L: PromLabelsExt<'a>>( &self, labels: L ) -> DeleteOnDropCounter<'a, Self::CounterType, L>

Returns a counter that deletes its labels from this metrics vector when dropped. See DeleteOnDropCounter for a detailed description.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<P: Atomic> CounterVecExt for GenericCounterVec<P>

§

type CounterType = P

source§

fn get_delete_on_drop_counter<'a, L: PromLabelsExt<'a>>( &self, labels: L ) -> DeleteOnDropCounter<'a, Self::CounterType, L>

Implementors§