Skip to main content

TemporalSensor

Struct TemporalSensor 

Source
pub struct TemporalSensor { /* private fields */ }
Expand description

Rolling estimator over send/receive timing.

Implementations§

Source§

impl TemporalSensor

Source

pub fn new(window: usize) -> Self

Create a sensor whose OWD trend is computed over the last window samples (clamped to at least 2).

Source

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.

Source

pub fn jitter_micros(&self) -> f64

Current interarrival jitter (microseconds).

Source

pub fn interarrival_micros(&self) -> f64

Mean interarrival spacing (microseconds).

Source

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.

Source

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.

Source

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.

Source

pub fn samples(&self) -> usize

Number of OWD samples currently in the window.

Trait Implementations§

Source§

impl Debug for TemporalSensor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TemporalSensor

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.