pub struct LatencyStats {
pub p50: Duration,
pub p95: Duration,
pub p99: Duration,
pub samples_count: usize,
}Expand description
Aggregated latency statistics across a stress run.
Computed from the concatenation of every per-thread tracker’s samples.
§Example
use dev_stress::LatencyStats;
use std::time::Duration;
let stats = LatencyStats::from_samples(vec![
Duration::from_nanos(10),
Duration::from_nanos(20),
Duration::from_nanos(30),
Duration::from_nanos(40),
Duration::from_nanos(50),
]);
assert_eq!(stats.samples_count, 5);
assert_eq!(stats.p50, Duration::from_nanos(30));Fields§
§p50: Duration50th percentile sample.
p95: Duration95th percentile sample.
p99: Duration99th percentile sample.
samples_count: usizeTotal number of samples used to compute the percentiles.
Implementations§
Source§impl LatencyStats
impl LatencyStats
Sourcepub fn from_samples(samples: Vec<Duration>) -> Self
pub fn from_samples(samples: Vec<Duration>) -> Self
Compute percentile statistics from a sample set.
Returns zero-valued percentiles when samples is empty.
Trait Implementations§
Source§impl Clone for LatencyStats
impl Clone for LatencyStats
Source§fn clone(&self) -> LatencyStats
fn clone(&self) -> LatencyStats
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 LatencyStats
impl Debug for LatencyStats
Source§impl PartialEq for LatencyStats
impl PartialEq for LatencyStats
Source§fn eq(&self, other: &LatencyStats) -> bool
fn eq(&self, other: &LatencyStats) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for LatencyStats
impl StructuralPartialEq for LatencyStats
Auto Trait Implementations§
impl Freeze for LatencyStats
impl RefUnwindSafe for LatencyStats
impl Send for LatencyStats
impl Sync for LatencyStats
impl Unpin for LatencyStats
impl UnsafeUnpin for LatencyStats
impl UnwindSafe for LatencyStats
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