logging: label the perf tick rolling window and emit the interval count - #208
Merged
Merged
Conversation
The rolling tool-call group sat beside per-interval deltas without identifying its window, which caused a real idle-path stall misdiagnosis. Emit new_tool_calls, already computed as the activity gate, and label the retained ring occupancy as window without draining the rolling samples.
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.
Closes #206. Built to the shape you specced:
new:first in the group, carrying the already-computednew_tool_calls— it stays the emit gate, it's just no longer discarded after gatingcount→windowon both the field andToolCallPerfSummaryThe group's formatting moved into a small private
format_tool_call_summary(new_tool_calls, summary) -> String, called from the emit site. That's what makes the test possible without log capture or waiting forperf_tick_interval()to elapse —perf_tickearly-returns on the interval check and mutates process-globalPERF, so asserting on it directly would have been either timing-dependent or global-state-dependent. Everything else on the tick line is untouched.The test is the case you asked for — the one that proves the two fields mean different things:
Same 3.0s sample, same window;
new:drops to 0 whilemax_total_msstill reports it. That's the misdiagnosis shape, pinned.Field rename flagged as you asked:
count→windowinside thetoolcall={}group. Line-prefix consumers are unaffected; anything parsing that group's field names by name will need the rename.Verification:
--lib2283 passed / 6 skipped · release build clean ·cargo fmt --checkclean ·aft_inspect0/0/0/0. Red control run independently of the implementer's — swappingnew:back tocount:in the format string givesleft: "toolcall={count:1,window:1,…"against the expectednew:1.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Clarifies perf tick logging by emitting the per-interval
newtool-call count and labeling the rolling window size aswindow. This removes ambiguity between interval activity and the rolling sample window and closes #206.New Features
new:totoolcall={}usingnew_tool_calls(still the emit gate).counttowindowintoolcall={}andToolCallPerfSummary.format_tool_call_summary()and add a unit test to distinguishnewvswindow.Migration
toolcall.counttotoolcall.window.Written for commit 3f7f84e. Summary will update on new commits.
Greptile Summary
The PR clarifies tool-call performance logging by emitting the interval call count separately from the rolling sample-window size.
newas the first field in thetoolcall={}group.counttowindow.Confidence Score: 5/5
The PR appears safe to merge, with the intentional logging-field contract change clearly documented and tested.
The interval counter is derived from the existing cumulative tool-call counter at emitted-tick boundaries, while the renamed window field continues to describe the retained rolling sample buffer; no changed-code-triggered failure remains.
Important Files Changed
Reviews (1): Last reviewed commit: "logging: label the perf tick rolling win..." | Re-trigger Greptile