pub struct LatencyHistogram { /* private fields */ }Expand description
Per-node latency histogram with 32 power-of-two nanosecond buckets.
Bucket k covers the range [2^(k-1) ns, 2^k ns) for k >= 1.
Bucket 0 covers 0 ns exactly.
Bucket 31 is a catch-all for values >= 2^30 ns (~1.07 s).
All operations are O(1) for record and O(32) for percentile queries.
Implementations§
Source§impl LatencyHistogram
impl LatencyHistogram
Sourcepub fn mean_ns(&self) -> f64
pub fn mean_ns(&self) -> f64
Returns the mean latency in nanoseconds, or 0.0 if no samples recorded.
Sourcepub fn percentile_ns(&self, pct: f64) -> u64
pub fn percentile_ns(&self, pct: f64) -> u64
Returns the approximate latency at the pct-th percentile (0.0-100.0).
Returns the lower bound of the bucket containing the pct-th sample.
Sourcepub fn total_samples(&self) -> u64
pub fn total_samples(&self) -> u64
Returns the total number of recorded samples.
Trait Implementations§
Source§impl Clone for LatencyHistogram
impl Clone for LatencyHistogram
Source§fn clone(&self) -> LatencyHistogram
fn clone(&self) -> LatencyHistogram
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LatencyHistogram
impl Debug for LatencyHistogram
Auto Trait Implementations§
impl Freeze for LatencyHistogram
impl RefUnwindSafe for LatencyHistogram
impl Send for LatencyHistogram
impl Sync for LatencyHistogram
impl Unpin for LatencyHistogram
impl UnsafeUnpin for LatencyHistogram
impl UnwindSafe for LatencyHistogram
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more