Add Stopwatch.Reporter utility and refactor Rate_Group to use it - #190
Merged
Conversation
dinkelk
force-pushed
the
feature/stopwatch-reporter
branch
3 times, most recently
from
July 30, 2026 17:23
add9853 to
835b1ce
Compare
Jbsco
requested changes
Jul 30, 2026
Jbsco
left a comment
Collaborator
There was a problem hiding this comment.
Some callouts, also wondering if timing_report.record.yaml should move to src/types/task/, alongside task_timing_report.record.yaml.
And should the Max_Cycle_Time_Exceeded value assertion in the Rate_Group suite be restored as part of this?
dinkelk
force-pushed
the
feature/stopwatch-reporter
branch
from
July 30, 2026 18:53
83f827c to
33c33bc
Compare
Collaborator
Author
|
Thanks for the review. All addressed and squashed back to 2 commits:
|
dinkelk
commented
Jul 30, 2026
dinkelk
force-pushed
the
feature/stopwatch-reporter
branch
from
July 30, 2026 19:13
33c33bc to
bb80d7f
Compare
Jbsco
self-requested a review
July 30, 2026 19:26
dinkelk
force-pushed
the
feature/stopwatch-reporter
branch
from
July 31, 2026 15:05
bb80d7f to
ad63daf
Compare
Jbsco
approved these changes
Jul 31, 2026
Jbsco
left a comment
Collaborator
There was a problem hiding this comment.
src/components/rate_group/types/ is now an empty directory, except for .all_path, could be removed in this PR, but not blocking. Otherwise looks good!
dinkelk
force-pushed
the
feature/stopwatch-reporter
branch
from
July 31, 2026 17:01
ad63daf to
ea814a6
Compare
Collaborator
Author
addressed. |
Combines a wall-clock and CPU-execution stopwatch pair for timing a section of code. Accumulates recent-maximum and all-time-maximum values for both timers and reports them as a Task_Timing_Report.T, the same type the Rate_Group component publishes, so measurements from any component can be collected into a common downlink packet. The wall clock start and stop times may be supplied externally, which supports backdating a measurement to an incoming tick's timestamp so that queue latency is included. Stop is also available in split Stop_Cpu_Timer and Stop_Wall_Timer halves so that an expensive wall stop time acquisition can be excluded from the CPU measurement. Accumulate optionally reports whether either all-time maximum was updated, supporting time-exceeded events. Report_Last provides per-operation reporting, carrying the most recent measurement alongside the all-time maximums. Includes a unit test suite exercising the timer pair, accumulation, report contents, and reset behavior with deterministic injected times.
Replace the hand-rolled maximum tracking, timing report conversion, and recent-maximum reset logic in the Rate_Group tick handler with the new Stopwatch.Reporter utility. Behavior is unchanged: the wall measurement still starts at the incoming tick's timestamp, the system time fetch for the wall stop remains excluded from the CPU measurement (via the split stop), the time-exceeded events still fire when either all-time maximum updates, and the data product contents are identical. Also move timing_report.record.yaml next to task_timing_report.record.yaml in src/types/task, and restore the max cycle time value assertion in the unit test suite; the wall measurement is deterministic in test since it spans the tick timestamp to the tester-provided system time.
dinkelk
force-pushed
the
feature/stopwatch-reporter
branch
from
July 31, 2026 17:40
ea814a6 to
334857e
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.
Summary
Adds
Stopwatch.Reporter, a child package ofStopwatchthat pairs a wall-clock and CPU-execution stopwatch for timing a section of code, accumulates recent-maximum and all-time-maximum values for both, and reports them as aTask_Timing_Report.T(the same typeRate_Grouppublishes, so measurements from any component can share a downlink packet).The
Rate_Groupcomponent previously hand-rolled exactly this logic in its tick handler; the second commit refactors it to use the new package (net -38 lines) with identical behavior.Design notes
Start/Stopoverloads accept an externally supplied wall clock time, supporting backdating a measurement to an incoming tick's timestamp so queue latency is included (the Rate_Group pattern), or supplying both endpoints from convertedSys_Timestamps.Accumulateoptionally reports whether either all-time maximum was updated, supporting Rate_Group's time-exceeded events.Report_Lastcarries the most recent measurement alongside the all-time maximums, for components that publish a report per operation rather than periodically.Instanceis a public record, matching the parentStopwatchstyle.Validation
src/util/stopwatch/test, 4 tests) exercising start/stop with injected times, accumulation and max-updated indications, both report variants, and both resets: 4/4 pass.Rate_Groupunit tests pass unmodified against the refactor.redo stylepasses on both directories.