-
Notifications
You must be signed in to change notification settings - Fork 602
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
Time Series should use the IO.monotonic
under the hood?
#2960
Comments
@floating-cat Any thoughts on the approach in #2961? In essence, we provide either option to folks. We can't switch to monotonic time without significantly breaking client code. |
As a note, I would recommend swapping to |
@djspiewak I wrote the original, where the timestamp was used on a user interface. In the case of system time adjustments, we were okay with dropping data from |
@mpilquist so the thought then is that the drift as system time adjusts is intentional and desirable? If that's the case then I'm aligned with your prior conclusion that we should just have both. 🙂 Swapping to |
@mpilquist Hi, the approach in #2961 is good to me. The Swapping to |
Add ability to have a monotonic time series (fixes #2960)
fs2 version: 3.2.11
Steps:
sudo date --set='-10 seconds'
)Current Result:
The code doesn't print any output because the time is backward and all values are dropped in these 10 seconds.
Expect Result:
All values including the tick signals are emitted.
Use cases:
In a client app, the user could change the time if their system time is not correct. Or the system clock is adjusted for some reason.
Reason:
In fs2
TimeSeries
, the code useTimeStamped.reorderLocally
to reoder the tickts.But it use the
TimeStamped.unsafeNow
under the hood which use theSystem.currentTimeMillis()
which is not monotonic.If the time is backward,
reorderOver
value, my source steam values are dropped because the code is usingTimeStamped.reorderLocally
under the hood which would drop the values if values are not ordered and some combinators in the Time Series need the guarantee of the order too.reorderOver
value, my original source steam values are reordered which breaks the code logic if I use the output stream directlyShould the Time Series use the
IO.monotonic
under the hood instead of theSystem.currentTimeMillis()
?Or maybe we should not use source values emitted from Time Series if any emitted values order/no loss are important?
The text was updated successfully, but these errors were encountered: