You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(load): progress lines, --load-interval time series and --load-warmup - #2916
Part of #2838 (items 1–3). The issue stays open for items 5, 7 and 8, which follow in one more PR; items 4 and 6 landed in #2915, and item 9 is filed as #2910–#2914.
What
Progress (item 1). Every --load-progress <sec> (default 5), a line goes to stderr:
It shows the totals so far, plus the completion rate and the successful-call p50/p99 over the last interval. It is prefixed warm-up or stage N when that applies.
In the one-shot CLI it is on by default, and --quiet turns it off.
In mcpdo, the daemon writes each report as a new one-way load-progress frame on the rpc call's socket, ahead of the response. This uses a new optional ElicitationChannel.notify, and the client gets an onLoadProgress option. The front end prints it to stderr only with --format text: --format json strips progressMs before sending, so the daemon emits nothing.
Time series (item 2).--load-interval <sec> adds intervals[], the run's calls bucketed by completion time.
Buckets are half-open, (start, end], so a completion on a boundary counts in the interval it finished.
Empty intervals are included, so the series has no gaps.
Each bucket carries the usual counts, rates, latencies and tallies. Buckets use small recorders that switch to the histogram early (200 exact samples).
A stepped run carries intervals per stage.
Warm-up (item 3).--load-warmup <sec> first runs a window at the same concurrency, rate and connections, whose calls are discarded. It holds to its deadline, and then the measured window runs.
warmup reports durationMs, requests, ok and failed.
A warm-up that stops early (breaker, interrupt) ends the run: the measured window starts with that stop already in place, so it runs nothing and reports the same reason.
{{seq}} keeps counting across the two windows.
Refused with --load-steps / --load-ramp (load_flag_conflict).
mcpdo's text summary adds a warm-up line and one line per interval.
Tests
New clients/cli/__tests__/load-progress.test.ts. It covers option resolution and the refusal. On a fake clock: warm-up exclusion, timing and seq; a warm-up that stops the run; interval bucketing with a gap; boundary handling and per-stage series; progress contents, labels and the no-success case; the line format. End to end: progress on stderr plus intervals plus a warm-up, --quiet, the refusal, and requires---load.
mcpdo: daemon progress frames (relayed; none without progressMs or without notify), the channel's notify (written before the response, dropped once the socket is gone), flag resolution, text rendering, and a live-daemon run showing progress in text mode and none in JSON.
Docs: CLI README (flag rows plus a "Watching a run" section), mcpdo README, skills/mcpdo/SKILL.md. npm run local:gate green.
…rmup (#2838)
Items 1-3 of #2838:
- Progress: a stderr line every --load-progress seconds (default 5) with the
totals and the last interval's rate and p50/p99; --quiet turns it off.
mcpdo relays it from the daemon as one-way load-progress frames, shown in
--format text only.
- --load-interval <sec>: an intervals[] time series by completion time.
- --load-warmup <sec>: a warm-up window left out of every statistic.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Progress notifications can exhaust daemon memory for slow clients, while staged text output omits interval data and a timing-sensitive test can fail on correct behavior.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Warm-up reporting uses the requested rather than actual elapsed duration, and progress reporting in both frontends ignores stderr backpressure, risking unbounded memory growth.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Drop progress reports while stderr is backpressured
clients/cli/src/cli.ts:2202
When stderr is piped to a slow or non-reading consumer, each progress tick keeps buffering another line even after write() returns false, so frequent reports over a long run can exhaust the frontend's memory. Drop advisory reports while process.stderr.writableNeedDrain is true to keep reporting nonblocking and bounded. Apply the same guard in clients/mcpdo/src/connection/dispatch.ts:146; the daemon's socket-buffer cap does not bound the frontend's stderr queue.
Report actual warm-up duration after early termination
core/cli/handlers/load-test.ts:818
The warm-up reports its requested duration rather than the time it actually ran. For example, if --load-warmup 60 trips the breaker after 50 ms, this returns durationMs: 60000, and mcpdo prints a 60-second warm-up despite the early stop. Use warm.elapsedMs here so the reported duration also accounts correctly for early termination and in-flight calls draining past the deadline.
Copilot round 2 (review 5785305896): no inline comments. Both findings were in the "previously missed issues" block, so they are answered here. Both fixed in 7f00a50:
Progress writes ignore stderr backpressure: both front ends (cli.tswriteLoadProgress, mcpdo dispatch.tsonLoadProgress) now skip a line while process.stderr.writableNeedDrain is true, so reporting stays non-blocking and bounded. Tested in each by holding stderr backed up for a run.
Warm-up reports its requested duration: warmup.durationMs is now the warm-up's actual elapsedMs, shorter on an early stop and longer when calls drain past it. Tested.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Warm-up unnecessarily retains interval data with memory use proportional to its duration, and premature elapsed-time rounding can report zero throughput for a nonempty final bucket.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Disable interval collection during the warm-up
core/cli/handlers/load-test.ts:810
The warm-up inherits intervalMs through ...options, so runWindow() retains a bucket for every warm-up interval and computes the full time-series summary, only for warm.intervals to be discarded. A long warm-up with fine intervals therefore consumes memory proportional to its length even when the measured run is short. Clear intervalMs in the warm-up options so only the measured window collects the series.
Use the unrounded end time for bucket throughput
core/cli/handlers/load-test.ts:1194
Rounding elapsedMs before computing the bucket duration can give a nonempty final bucket zero throughput. For example, with 1000 ms intervals and a final completion at 1000.001 ms, that completion lands in bucket 2, but its end is rounded down to its start (1000), so both throughput fields become 0. Keep the unrounded end for rate calculations and round only the serialized offsets.
Copilot round 3 (review 5785464078): no inline comments. Both findings were in the "previously missed issues" block, so they are answered here. Both fixed in e29cb43:
The warm-up keeps a time series it throws away: the warm-up window now runs with intervalMs cleared, so only the measured window builds buckets. A test confirms the measured series is unaffected; the discarded buckets are not observable from outside, so it cannot fail on the old code.
Rounded elapsedMs zeroes a final sliver bucket's rate: bucket rates now use the unrounded end, and only the reported startMs/endMs are rounded. A regression test covers a completion at 1000.001 ms on 1000 ms intervals.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because an unpublished finding identifies help text recommending an unsupported --quiet option that fails with an unknown-option error.
Copilot round 4 (review 5785597578): no inline comments. The headline flagged help text pointing at an unsupported --quiet. Fixed in 6386cb6:
mcpdo's --load-progress help now says the line is shown with --format text only, and that --format json prints none, which is how mcpdo actually silences it. I had copied the old text from the one-shot CLI, where --quiet does exist. A test checks tools/call --help.
Copilot review loop closed: round 5 (review 5785719044) was clean, with no inline comments, no headline finding and no suppressed block. All findings from rounds 1–4 were fixed.
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
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.
Part of #2838 (items 1–3). The issue stays open for items 5, 7 and 8, which follow in one more PR; items 4 and 6 landed in #2915, and item 9 is filed as #2910–#2914.
What
Progress (item 1). Every
--load-progress <sec>(default 5), a line goes to stderr:warm-uporstage Nwhen that applies.--quietturns it off.load-progressframe on therpccall's socket, ahead of the response. This uses a new optionalElicitationChannel.notify, and the client gets anonLoadProgressoption. The front end prints it to stderr only with--format text:--format jsonstripsprogressMsbefore sending, so the daemon emits nothing.Time series (item 2).
--load-interval <sec>addsintervals[], the run's calls bucketed by completion time.(start, end], so a completion on a boundary counts in the interval it finished.intervalsper stage.Warm-up (item 3).
--load-warmup <sec>first runs a window at the same concurrency, rate and connections, whose calls are discarded. It holds to its deadline, and then the measured window runs.warmupreportsdurationMs,requests,okandfailed.{{seq}}keeps counting across the two windows.--load-steps/--load-ramp(load_flag_conflict).mcpdo's text summary adds a warm-up line and one line per interval.
Tests
clients/cli/__tests__/load-progress.test.ts. It covers option resolution and the refusal. On a fake clock: warm-up exclusion, timing andseq; a warm-up that stops the run; interval bucketing with a gap; boundary handling and per-stage series; progress contents, labels and the no-success case; the line format. End to end: progress on stderr plus intervals plus a warm-up,--quiet, the refusal, and requires---load.progressMsor withoutnotify), the channel'snotify(written before the response, dropped once the socket is gone), flag resolution, text rendering, and a live-daemon run showing progress in text mode and none in JSON.Docs: CLI README (flag rows plus a "Watching a run" section), mcpdo README,
skills/mcpdo/SKILL.md.npm run local:gategreen.🤖 Generated with Claude Code