Commit a31fdcf
committed
Add a wall clock attached timer for the resampler
This timer uses the wall clock to trigger ticks and handles
discrepancies between the wall clock and monotonic time. Since sleeping
is performed using monotonic time, differences between the two clocks
can occur.
When the wall clock progresses slower than monotonic time, it is
referred to as *compression* (wall clock time appears in the past
relative to monotonic time). Conversely, when the wall clock progresses
faster, it is called *expansion* (wall clock time appears in the future
relative to monotonic time). If these differences exceed a configured
threshold, a warning is emitted.
If the difference becomes excessively large, it is treated as a *time
jump*. Time jumps can occur, for example, when the wall clock is
adjusted by NTP after being out of sync for an extended period. In such
cases, the timer resynchronizes with the wall clock and triggers an
immediate tick.
Signed-off-by: Leandro Lucarella <[email protected]>1 parent f3d594e commit a31fdcf
File tree
2 files changed
+856
-0
lines changed- src/frequenz/sdk/timeseries
- _resampling
2 files changed
+856
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
60 | 70 | | |
0 commit comments