Struct metered::common::ResponseTime
source · [−]pub struct ResponseTime<H: Histogram = AtomicHdrHistogram, T: Instant = StdInstant>(pub H, _);
Expand description
A metric measuring the response time of an expression, that is the duration the expression needed to complete.
Because it retrieves the current time before calling the expression, computes the elapsed duration and registers it to an histogram, this is a rather heavy-weight metric better applied at entry-points.
By default, ResponseTime
uses an atomic hdr histogram and a synchronized
time source, which work better in multithread scenarios. Non-threaded
applications can gain performance by using unsynchronized structures
instead.
Tuple Fields
0: H
Trait Implementations
sourceimpl<H: Histogram, T: Instant> Clear for ResponseTime<H, T>
impl<H: Histogram, T: Instant> Clear for ResponseTime<H, T>
sourceimpl<H: Clone + Histogram, T: Clone + Instant> Clone for ResponseTime<H, T>
impl<H: Clone + Histogram, T: Clone + Instant> Clone for ResponseTime<H, T>
sourcefn clone(&self) -> ResponseTime<H, T>
fn clone(&self) -> ResponseTime<H, T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<H: Histogram, T: Instant> Default for ResponseTime<H, T>
impl<H: Histogram, T: Instant> Default for ResponseTime<H, T>
sourceimpl<H: Histogram, T: Instant> Deref for ResponseTime<H, T>
impl<H: Histogram, T: Instant> Deref for ResponseTime<H, T>
sourceimpl<H: Histogram, T: Instant> Enter for ResponseTime<H, T>
impl<H: Histogram, T: Instant> Enter for ResponseTime<H, T>
sourceimpl<H: Histogram, T: Instant, R> OnResult<R> for ResponseTime<H, T>
impl<H: Histogram, T: Instant, R> OnResult<R> for ResponseTime<H, T>
sourcefn leave_scope(&self, enter: T) -> Advice
fn leave_scope(&self, enter: T) -> Advice
Called when an expression has exited, but the return value isn’t known.
This can happen because of a panic, or if control flow bypasses a macro.
This is also called by the default implementation of on_result
. Read more
impl<H: Histogram, T: Instant, R> Metric<R> for ResponseTime<H, T>
Auto Trait Implementations
impl<H, T> RefUnwindSafe for ResponseTime<H, T> where
H: RefUnwindSafe,
T: RefUnwindSafe,
impl<H, T> Send for ResponseTime<H, T> where
H: Send,
T: Send,
impl<H, T> Sync for ResponseTime<H, T> where
H: Sync,
T: Sync,
impl<H, T> Unpin for ResponseTime<H, T> where
H: Unpin,
T: Unpin,
impl<H, T> UnwindSafe for ResponseTime<H, T> where
H: UnwindSafe,
T: UnwindSafe,
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