Repository navigation
Expose final retry counters in JSON totals - #801
Conversation
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. Thanks for this. Went through it, and it looks good to me. The new keys only appear in One question, since JSON keys are hard to rename once they ship: did you consider a more specific name than plain Nitpicking: the merge commit from master in the branch history should go away if this is squash-merged. Otherwise this looks ready to me once CI is green. |
|
The name is deliberate: this exposes the existing logical-error counter used by progress output and Prometheus. It includes terminal non-retryable error replies as well as retry exhaustion and abandoned replays, so “Retry Errors” could imply the narrower count of failed resends. “Connection Errors” remains the distinct connection-event counter. README documents that boundary, and the fields are emitted only with retry handling enabled so ordinary JSON keeps its existing shape. No request completion or exit-code semantics change. This PR will be squash-merged after all seven independent reviews and the final CI/bot gates pass, so the integration merge commit will not appear separately in master history. |
Problem
With
--retry-on-error, final JSON omits logical errors and retry activity even though progress output and Prometheus expose those counters. A run whose six requests all exhaust two retries reports Count6 and zero connection errors without showing its six logical failures or twelve retries.Root cause
The JSON writer has no retry payload.
run_stats::summarize()also omits the three per-run counters, so aggregating into fresh storage loses them even though client merges already sum them correctly.Fix
Preserve retry counters when summarizing and expose unsigned integer
Errors,Retry Attempts, andRetried Opsunder JSONTotalswhen retry handling is enabled, including zero values. Command rows do not repeat unattributed global counts. Retry-disabled output keeps its existing field set. Per-run and selected BEST/WORST sections retain actual counts; aggregate sections use the existing rounded, nonzero-preserving mean over actual reported run objects.The counters expose existing retry accounting: attempts mean queued retries, which may be canceled before a physical resend, and retried operations count logical requests queued at least once. Request completion, error handling, exit status, text tables and metric schemas are unchanged.
Tests
cd43101.d362619becauseErrorsis missing. They pass on the final build: two threads/two clients, recovery/exhaustion/zero controls, mixed arbitrary commands in grouped and per-line output, retry-disabled shape, per-run/BEST/WORST/aggregate output, and interrupted5-run series with only2 reported run objects.Affected versions
Retry counters were introduced by
08cfc24ac3a056fadbaac7a225ed260aee8f6431(#381) without final JSON exposure.git tag --containsidentifies 2.4.0 through2.5.2, plus master. This release range is history-derived; actual baseline reproduction usedd362619, and the final implementation is composed withcd43101.Fixes #646.
🤖 Generated with Claude Code