Struct metered::common::Throughput
source · [−]pub struct Throughput<T: Instant = StdInstant, P: RecordThroughput = AtomicTxPerSec<T>>(pub P, _);
Expand description
A metric providing a transaction per second count backed by a histogram.
Because it retrieves the current time before calling the expression, stores it to appropriately build time windows of 1 second and registers results to a histogram, this is a rather heavy-weight metric better applied at entry-points.
By default, Throughput
uses an atomic transaction count backend 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: P
Trait Implementations
sourceimpl<P: RecordThroughput + Clear, T: Instant> Clear for Throughput<T, P>
impl<P: RecordThroughput + Clear, T: Instant> Clear for Throughput<T, P>
sourceimpl<T: Clone + Instant, P: Clone + RecordThroughput> Clone for Throughput<T, P>
impl<T: Clone + Instant, P: Clone + RecordThroughput> Clone for Throughput<T, P>
sourcefn clone(&self) -> Throughput<T, P>
fn clone(&self) -> Throughput<T, P>
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<P: RecordThroughput + Debug, T: Instant> Debug for Throughput<T, P>
impl<P: RecordThroughput + Debug, T: Instant> Debug for Throughput<T, P>
sourceimpl<P: RecordThroughput, T: Instant> Default for Throughput<T, P>
impl<P: RecordThroughput, T: Instant> Default for Throughput<T, P>
sourceimpl<P: RecordThroughput, T: Instant> Deref for Throughput<T, P>
impl<P: RecordThroughput, T: Instant> Deref for Throughput<T, P>
sourceimpl<P: RecordThroughput, T: Instant> Enter for Throughput<T, P>
impl<P: RecordThroughput, T: Instant> Enter for Throughput<T, P>
sourceimpl<P: RecordThroughput + Serialize, T: Instant, R> OnResult<R> for Throughput<T, P>
impl<P: RecordThroughput + Serialize, T: Instant, R> OnResult<R> for Throughput<T, P>
sourcefn leave_scope(&self, _enter: ()) -> Advice
fn leave_scope(&self, _enter: ()) -> 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
sourceimpl<P: RecordThroughput + Serialize, T: Instant> Serialize for Throughput<T, P>
impl<P: RecordThroughput + Serialize, T: Instant> Serialize for Throughput<T, P>
impl<P: RecordThroughput + Serialize + Clear, T: Instant, R> Metric<R> for Throughput<T, P>
Auto Trait Implementations
impl<T, P> RefUnwindSafe for Throughput<T, P> where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> Send for Throughput<T, P> where
P: Send,
T: Send,
impl<T, P> Sync for Throughput<T, P> where
P: Sync,
T: Sync,
impl<T, P> Unpin for Throughput<T, P> where
P: Unpin,
T: Unpin,
impl<T, P> UnwindSafe for Throughput<T, P> where
P: 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