Struct mz_ore::metrics::DeleteOnDropHistogram
source · [−]pub struct DeleteOnDropHistogram<'a, L> where
L: PromLabelsExt<'a>, {
inner: Histogram,
labels: L,
vec: HistogramVec,
_phantom: &'a PhantomData<()>,
}
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.
Fields
inner: Histogram
labels: L
vec: HistogramVec
_phantom: &'a PhantomData<()>
Implementations
sourceimpl<'a, L> DeleteOnDropHistogram<'a, L> where
L: PromLabelsExt<'a>,
impl<'a, L> DeleteOnDropHistogram<'a, L> where
L: PromLabelsExt<'a>,
fn from_metric_vector(vec: HistogramVec, labels: L) -> Self
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) -> T where
F: FnOnce() -> T,
pub fn observe_closure_duration<F, T>(&self, f: F) -> T where
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
sourceimpl<'a, L: Debug> Debug for DeleteOnDropHistogram<'a, L> where
L: PromLabelsExt<'a>,
impl<'a, L: Debug> Debug for DeleteOnDropHistogram<'a, L> where
L: PromLabelsExt<'a>,
sourceimpl<'a, L> Deref for DeleteOnDropHistogram<'a, L> where
L: PromLabelsExt<'a>,
impl<'a, L> Deref for DeleteOnDropHistogram<'a, L> where
L: PromLabelsExt<'a>,
sourceimpl<'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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more