pub struct RttShape { /* private fields */ }Expand description
Streaming RTT-distribution shape estimator.
Implementations§
Source§impl RttShape
impl RttShape
pub fn new() -> Self
Sourcepub fn observe(&mut self, rtt_us: f64)
pub fn observe(&mut self, rtt_us: f64)
Fold one RTT sample (microseconds) into the running moments via Pebay’s streaming update of the first four central moments.
Sourcepub fn bimodality(&self) -> Option<f64>
pub fn bimodality(&self) -> Option<f64>
Sarle’s bimodality coefficient b = (skewness^2 + 1) / kurtosis, or
None until MIN_SAMPLES samples and a non-degenerate spread. b is
bounded 0..=1; above SARLE_THRESHOLD the distribution is bimodal.
Sourcepub fn wifi_confidence(&self) -> f32
pub fn wifi_confidence(&self) -> f32
Confidence in 0..=1 that the path carries a Wi-Fi hop, from how far the
bimodality coefficient sits above Sarle’s threshold. 0 below threshold
(unimodal - wired) or before enough samples; rising to 1 as the RTT
distribution becomes strongly two-peaked (Wi-Fi MAC retransmission).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RttShape
impl RefUnwindSafe for RttShape
impl Send for RttShape
impl Sync for RttShape
impl Unpin for RttShape
impl UnsafeUnpin for RttShape
impl UnwindSafe for RttShape
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