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§
Source§impl<H: Clone + Histogram, T: Clone + Instant> Clone for ResponseTime<H, T>
impl<H: Clone + Histogram, T: Clone + Instant> Clone for ResponseTime<H, T>
Source§fn clone(&self) -> ResponseTime<H, T>
fn clone(&self) -> ResponseTime<H, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<H: Histogram, T: Instant, R> OnResult<R> for ResponseTime<H, T>
impl<H: Histogram, T: Instant, R> OnResult<R> for ResponseTime<H, T>
Source§fn 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
.impl<H: Histogram, T: Instant, R> Metric<R> for ResponseTime<H, T>
Auto Trait Implementations§
impl<H, T> Freeze for ResponseTime<H, T>where
H: Freeze,
impl<H, T> RefUnwindSafe for ResponseTime<H, T>where
H: RefUnwindSafe,
T: RefUnwindSafe,
impl<H, T> Send for ResponseTime<H, T>
impl<H, T> Sync for ResponseTime<H, T>
impl<H, T> Unpin for ResponseTime<H, T>
impl<H, T> UnwindSafe for ResponseTime<H, T>where
H: UnwindSafe,
T: UnwindSafe,
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