feat: tell the collector how far to trust the timestamp - #9
Merged
Conversation
Contributor
Author
|
@coderabbitai pause |
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
Comment |
✅ Action performedReviews paused. |
DavidCozens
force-pushed
the
stage-08-tcp
branch
from
August 16, 2026 21:48
4e877a9 to
e6bc53a
Compare
timeQuality joins the record, and meta gains sysUpTime. wire ... BOOT [meta sequenceId="1" sysUpTime="385"][timeQuality tzKnown="1" isSynced="0"] device started Flash +7,644 B (+296 on the previous stage) RAM +7,688 B (+24) Log stack +672 B (unchanged) Service +896 B (unchanged) This device reads the host clock once at boot and then free-runs on the FreeRTOS tick, so isSynced is 0 and the callback writes no syncAccuracy. The library zero-initialises the struct before the call and drops an accuracy written alongside an unsynced clock, so two fields are the whole of it. sysUpTime accompanies the sequence number: after a reboot the sequence restarts at one, and an uptime near zero distinguishes that from a counter wrap. It is one more field on a config struct that already existed. The element lands before the store because store-and-forward breaks the assumption that a record reaches the collector shortly after it was raised. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DavidCozens
force-pushed
the
stage-09-time-quality
branch
from
August 16, 2026 21:49
4991869 to
0b96bbd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
SolidSyslogTimeQualitySd, and giveMetaSdan uptime source alongside its counter.Time quality states how far the clock can be trusted, which matters when comparing events from
different devices.
This device reads the host clock once at boot and then free-runs on the FreeRTOS tick, so
isSyncedis
0and the callback writes nosyncAccuracy.tzKnownis1; the device works in UTCthroughout.
sysUpTimeaccompanies the sequence number. After a reboot the sequence restarts at one, and anuptime near zero distinguishes that from a counter wrap.
The element lands before the store because store-and-forward breaks the assumption that a record
reaches the collector shortly after it was raised. A record can arrive hours later, so the device
states what its clock is worth first.
When you need it. If events from this device will be ordered against events from others, or if a
record's timestamp will be relied on after a delay.