Expand description
A metric providing an in-flight gauge, showing how many calls are currently active for an expression.
This is a light-weight metric.
This makes sense mostly in a multi-threaded situation where several threads may call the same method constantly, and we want to monitor how many are active at a given time.
The [Throughput
] metric shows an alternative view
of the same picture, by reporting how many transactions per seconds are
processed by an expression.
By default, InFlight
uses a lock-free u64
Gauge
, which makes sense
in multithread scenarios. Non-threaded applications can gain performance by
using a std::cell:Cell<u64>
instead.
Tuple Fields
0: G
Trait Implementations
sourceimpl<G: Gauge, R> OnResult<R> for InFlight<G>
impl<G: Gauge, R> OnResult<R> for InFlight<G>
sourcefn leave_scope(&self, _: ()) -> Advice
fn leave_scope(&self, _: ()) -> 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<G: Gauge, R> Metric<R> for InFlight<G>
Auto Trait Implementations
impl<G> RefUnwindSafe for InFlight<G> where
G: RefUnwindSafe,
impl<G> Send for InFlight<G> where
G: Send,
impl<G> Sync for InFlight<G> where
G: Sync,
impl<G> Unpin for InFlight<G> where
G: Unpin,
impl<G> UnwindSafe for InFlight<G> where
G: 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