docs: say that HrtRateFit::toSeconds returns producer-epoch, not wall, seconds
The fit keeps the slope and discards the intercept, so the result counts from the producer's boot. Tasks 4 and 7 compose it with ClockOffset::map, which is correct, but the bare name invites passing it straight to a plot axis. Also unwrapped the stalled-clock assertion from behind `if (fit.ready())` — that branch never runs, so the test confirmed nothing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e4817dd284
commit
c89decef8e
@@ -63,6 +63,15 @@ public:
|
||||
void add(uint64_t hrt, double wallSec);
|
||||
bool ready() const { return n_ >= kMinSamples && rate_ > 0.0; }
|
||||
double ticksPerSecond() const { return rate_; }
|
||||
/**
|
||||
* @brief Converts a tick count to seconds on the PRODUCER's own epoch.
|
||||
*
|
||||
* The fit recovers the slope only and discards the intercept, so this is
|
||||
* `hrt / ticksPerSecond()` — not a wall-clock time. A producer's hrt counts
|
||||
* from its own boot, not from the Unix epoch. Pass the result to
|
||||
* ClockOffset::map() to land it on the wall clock; latching that arbitrary
|
||||
* epoch difference is precisely what ClockOffset is for.
|
||||
*/
|
||||
double toSeconds(uint64_t hrt) const;
|
||||
void reset();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user