pub struct ClockFilter { /* private fields */ }Expand description
Clock filter: keeps the last CLOCK_FILTER_SIZE samples and selects the one with the smallest round-trip delay as the best estimate.
Implementations§
Source§impl ClockFilter
impl ClockFilter
Sourcepub fn add_sample(&mut self, sample: NtpMeasurement)
pub fn add_sample(&mut self, sample: NtpMeasurement)
Add a new measurement to the filter.
Sourcepub fn best_sample(&self) -> Option<NtpMeasurement>
pub fn best_sample(&self) -> Option<NtpMeasurement>
Select the best sample (lowest absolute delay).
Sourcepub fn jitter_ms(&self) -> u64
pub fn jitter_ms(&self) -> u64
Compute jitter as root-mean-square of successive offset differences (integer square root approximation).
Sourcepub fn sample_count(&self) -> usize
pub fn sample_count(&self) -> usize
Number of valid samples in the filter.