pub struct TemporalSensor { /* private fields */ }Expand description
Rolling estimator over send/receive timing.
Implementations§
Source§impl TemporalSensor
impl TemporalSensor
Sourcepub fn new(window: usize) -> Self
pub fn new(window: usize) -> Self
Create a sensor whose OWD trend is computed over the last
window samples (clamped to at least 2).
Sourcepub fn observe(&mut self, send_ts: u64, recv_ts: u64)
pub fn observe(&mut self, send_ts: u64, recv_ts: u64)
Record one observation. send_ts and recv_ts are microseconds;
recv_ts uses the receiver’s clock, send_ts the sender’s. Only
their differences are used, so a constant clock offset between
the two is harmless.
Sourcepub fn jitter_micros(&self) -> f64
pub fn jitter_micros(&self) -> f64
Current interarrival jitter (microseconds).
Sourcepub fn interarrival_micros(&self) -> f64
pub fn interarrival_micros(&self) -> f64
Mean interarrival spacing (microseconds).
Sourcepub fn owd_trend(&self) -> f64
pub fn owd_trend(&self) -> f64
Slope of OWD over the window: microseconds of delay added per microsecond of wall time. Positive means the queue is building (congestion-driven loss is coming); near zero is a steady link; negative means the queue is draining. Clock-offset-invariant.
Sourcepub fn skew(&self) -> f64
pub fn skew(&self) -> f64
Estimated clock skew: the slope of the line lying BELOW all
(recv_ts, owd) samples (Moon-Skelly-Towsley). The minimum OWD for each
time is the queue-free path, whose drift is purely the relative clock
rate; queueing only ever adds delay ABOVE that line. Computed from the
lower convex hull of the window (the queue-free minimum points), whose
least-squares slope is the skew. Same units as owd_trend.
Sourcepub fn owd_trend_debiased(&self) -> f64
pub fn owd_trend_debiased(&self) -> f64
OWD trend with the clock skew removed: owd_trend - skew. On a steady
link a relative clock drift makes owd_trend read a false rising (or
falling) trend; subtracting the skew leaves only genuine queue
variation, so a steady-but-skewed link reads ~0.