-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow measurements without delay #1673
base: main
Are you sure you want to change the base?
Allow measurements without delay #1673
Conversation
(cherry picked from commit e44e3a6)
(cherry picked from commit 0e3d4a4)
(cherry picked from commit 5e56877)
(cherry picked from commit ac99d08)
(cherry picked from commit 0a16d45)
(cherry picked from commit aeb8024)
(cherry picked from commit 77fa89a)
(cherry picked from commit b473d93)
(cherry picked from commit ff30d36)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1673 +/- ##
==========================================
- Coverage 81.33% 81.30% -0.03%
==========================================
Files 64 64
Lines 19751 19780 +29
==========================================
+ Hits 16065 16083 +18
- Misses 3686 3697 +11 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some choices around type leaking that I don't agree with. The actual logic changes seem ok though.
@@ -1,5 +1,6 @@ | |||
use std::{collections::HashMap, fmt::Debug, hash::Hash, time::Duration}; | |||
|
|||
pub use source::AveragingBuffer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd strongly prefer if we do not make this type public. This is basically an implementation detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 180f7e1
} | ||
} | ||
|
||
fn add_sock_source( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bit bikeshedding, but I would prefer a more generic name, as this is likely going to be used for more than just sock sources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 4a5f52b
@@ -242,52 +242,48 @@ impl<SourceId: Hash + Eq + Copy + Debug, Controller: TimeSyncController<SourceId | |||
Ok(()) | |||
} | |||
|
|||
#[allow(clippy::type_complexity)] | |||
pub fn create_ntp_source( | |||
pub fn create_source_controller( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should leak the controllers out of system. I'd much rather have a thin-ish wrapper for non-ntp sources as well.
Although the idea of combining both nts and non-nts source creation isn't necessarily a bad thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed in cafc220 (as part of the other PR because here we do not have the sock source yet.)
This PR allows the
delay
property of measurements to be eitherNtpDuration
or()
. If the delay is()
, we use a constant value as the estimate of the measurement noise instead of an estimate based on the variance of delay values. This is useful for supporting alternative time sources, such as the SOCK protocol (#1632).The functions for creating a SOCK source are currently not covered by unit tests. I will add unit tests for these functions in a separate PR together with the actual implementation of the SOCK source.