Struct mz_ore::metrics::DeleteOnDropHistogram
source · pub struct DeleteOnDropHistogram<'a, L>where
L: PromLabelsExt<'a>,{ /* private fields */ }
Available on crate feature
metrics
only.Expand description
A GenericCounter
wrapper that deletes its labels from the vec when it is dropped
It adds a method to create a concrete metric from the vector that gets removed from the vector when the concrete metric is dropped.
NOTE: This type implements Borrow
, which imposes some constraints on implementers. To
ensure these constraints, do not implement any of the Eq
, Ord
, or Hash
traits on this.
type.
Methods from Deref<Target = Histogram>§
sourcepub fn start_timer(&self) -> HistogramTimer
pub fn start_timer(&self) -> HistogramTimer
Return a HistogramTimer
to track a duration.
sourcepub fn observe_closure_duration<F, T>(&self, f: F) -> Twhere
F: FnOnce() -> T,
pub fn observe_closure_duration<F, T>(&self, f: F) -> Twhere
F: FnOnce() -> T,
Observe execution time of a closure, in second.
sourcepub fn local(&self) -> LocalHistogram
pub fn local(&self) -> LocalHistogram
Return a LocalHistogram
for single thread usage.
sourcepub fn get_sample_sum(&self) -> f64
pub fn get_sample_sum(&self) -> f64
Return accumulated sum of all samples.
sourcepub fn get_sample_count(&self) -> u64
pub fn get_sample_count(&self) -> u64
Return count of all samples.
Trait Implementations§
source§impl<'a, L> Borrow<Histogram> for DeleteOnDropHistogram<'a, L>where
L: PromLabelsExt<'a>,
impl<'a, L> Borrow<Histogram> for DeleteOnDropHistogram<'a, L>where
L: PromLabelsExt<'a>,
source§impl<'a, L> Debug for DeleteOnDropHistogram<'a, L>where
L: PromLabelsExt<'a> + Debug,
impl<'a, L> Debug for DeleteOnDropHistogram<'a, L>where
L: PromLabelsExt<'a> + Debug,
source§impl<'a, L> Deref for DeleteOnDropHistogram<'a, L>where
L: PromLabelsExt<'a>,
impl<'a, L> Deref for DeleteOnDropHistogram<'a, L>where
L: PromLabelsExt<'a>,
source§impl<'a, L> Drop for DeleteOnDropHistogram<'a, L>where
L: PromLabelsExt<'a>,
impl<'a, L> Drop for DeleteOnDropHistogram<'a, L>where
L: PromLabelsExt<'a>,
Auto Trait Implementations§
impl<'a, L> !RefUnwindSafe for DeleteOnDropHistogram<'a, L>
impl<'a, L> Send for DeleteOnDropHistogram<'a, L>where
L: Send,
impl<'a, L> Sync for DeleteOnDropHistogram<'a, L>where
L: Sync,
impl<'a, L> Unpin for DeleteOnDropHistogram<'a, L>where
L: Unpin,
impl<'a, L> !UnwindSafe for DeleteOnDropHistogram<'a, L>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request