Skip to content

feat: tell the collector how far to trust the timestamp - #9

Merged
DavidCozens merged 1 commit into
mainfrom
stage-09-time-quality
Aug 16, 2026
Merged

feat: tell the collector how far to trust the timestamp#9
DavidCozens merged 1 commit into
mainfrom
stage-09-time-quality

Conversation

@DavidCozens

Copy link
Copy Markdown
Contributor

Add SolidSyslogTimeQualitySd, and give MetaSd an uptime source alongside its counter.

struct SolidSyslogMetaSdConfig metaConfig = {
    .Counter      = SolidSyslogStdAtomicCounter_Create(),
    .GetSysUpTime = SolidSyslogFreeRtos_GetSysUpTime,   /* new */
};
sd[1] = SolidSyslogTimeQualitySd_Create(SyslogTimeQuality);
... BOOT [meta sequenceId="1" sysUpTime="385"][timeQuality tzKnown="1" isSynced="0"] device started

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 isSynced
is 0 and the callback writes no syncAccuracy. tzKnown is 1; the device works in UTC
throughout.

sysUpTime accompanies the sequence number. After a reboot the sequence restarts at one, and an
uptime 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.

@DavidCozens

Copy link
Copy Markdown
Contributor Author

@coderabbitai pause

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews paused.

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
DavidCozens force-pushed the stage-09-time-quality branch from 4991869 to 0b96bbd Compare August 16, 2026 21:49
@DavidCozens
DavidCozens changed the base branch from stage-08-tcp to main August 16, 2026 21:49
@DavidCozens
DavidCozens merged commit 2ee5599 into main Aug 16, 2026
@DavidCozens
DavidCozens deleted the stage-09-time-quality branch August 16, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant