-
Notifications
You must be signed in to change notification settings - Fork 17
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
Resampled timestamps don't have constant interval #170
Comments
The An easy fix would be to replace the use of |
There are 2 problems here, I think:
|
OK, looking at the |
The resampler was using the timer timestamp to do the resampling, but this is wrong because the timer could (and probably always will) fire in the *future* (after the resampling period has passed). The effect was that samples produced by the resampler were not perfectly spread using an exact resampling period, but they included the error produced by the timer firing This PR fixes this issue and also fixes another bug found, samples in the future could have been included in a resampling window. Now we only consider relevant samples that fit to the exact resampling window. Part of #170.
Previous solution used Timer, that was fired after the specific time. Also it didn't take time difference spent on resampling into account when sleeping. In result the time difference between resampling period was constantly increasing. And there was no option to catch up with resampling. Fixes #170.
What happened?
The resampler uses the trigger times from a
frequenz.channels.Timer
as the timestamp for resampled messages. But theTimer
returns the clock time at which it triggered, and not a calculated timestamp that always has a constant interval, adjusting for any delays from the rest of the program, as seen below:What did you expect instead?
Timestamps in subsequent messages from the resampler should all have a constant interval, equal to the given resampling interval.
Affected version(s)
v0.16.0
Affected part(s)
Data pipeline (part:data-pipeline)
Extra information
No response
The text was updated successfully, but these errors were encountered: