Skip to content

Commit

Permalink
Bug fix for failing to update last_iter
Browse files Browse the repository at this point in the history
  • Loading branch information
davidv1992 committed Jun 27, 2024
1 parent 1ab7b9b commit 5012da1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ntp-proto/src/algorithm/kalman/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,16 @@ impl SourceFilter {
return false;
}

// This was a valid measurement, so no matter what this represents our current itertation time
// for the purposes of synchronizing
self.last_iter = measurement.localtime;

// Filter out one-time outliers (based on delay!)
if !self.prev_was_outlier
&& (measurement.delay.to_seconds() - self.roundtriptime_stats.mean())
> algo_config.delay_outlier_threshold * self.roundtriptime_stats.variance().sqrt()
{
self.prev_was_outlier = true;
self.last_iter = measurement.localtime;
return false;
}

Expand Down

0 comments on commit 5012da1

Please sign in to comment.