Repository navigation
Add configurable progress display interval - #129
Conversation
5798c60 to
057e8fb
Compare
|
ping @yossigo |
|
@wanghenshui thank you! Just be sure I understand correctly, so you basically want the ability to bump up the print rate to overcome lots of messages produced by Did you consider an option to suppress those messages altogether, possibly narrowing it down to an additional errors counter? |
we use memtier_benchmark as a stress tool, stress our redis-like server every day, print a log per second is also too much for analyze.
|
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. Thanks for picking this old one back up. Gating only the rendering, and leaving the supervision loop's
Overall this looks solid to me. I'd mostly like an answer on the (would file this as a comment, not a formal block) |
|
The intended scope is progress rendering only. The refreshed description follows the original author’s clarification that one progress update per second is too verbose; connection errors, supervision and metrics retain their existing cadence. I kept the proposed Fixed the man-page drift in 5303487: the cadence/sample wording now lives in The CI fallback is the same integration prerequisite as #257: fork runs otherwise fail during matrix expansion because the repository variable is empty, even with all visible jobs green. Configured values take precedence over the fallback, which matches the upstream seven-image list. Once #257 merges this shared prerequisite will disappear from this PR’s base diff. |
|
I agree with the naming/short-option point after the independent maintainer pass. Final head849f8a2 now exposes long-only The single gate around rendering stays: it makes the boundary between sampling and display explicit, whereas scattered fprintf guards would duplicate policy throughout the block. The histogram accumulation remains outside it. The maintainer review supports that tradeoff. The shared CI fallback has landed in #257 and is now incorporated through a normal master merge, so it is no longer a feature-specific change here. No default special-case was added: the same monotonic interval condition applies consistently, and a normal completion still forces its final frame. Timing checks pass6/6 in both optimized and combined ASan/LSan/UBSan builds, including the StatsD/CPU assertions. Independent controls caught a signed UINT_MAX narrowing mutant and verified long-running maximum intervals. A valid timed run can finish at101%, so the test now checks numeric completion>=100 rather than requiring an exact100% string; the renamed final suite passes6/6, and the merged head passes14unit programs. No local TSan execution is claimed; final CI remains required. |
|
Confirmed: The “cur” fields deliberately remain the most recent supervisor sample, even with a ten-second display interval. Changing their aggregation window would change existing metric/percentile semantics; help and README make this explicit, and independent output controls match the displayed values to the corresponding StatsD tick. Interrupt/setup-abort paths intentionally retain their previous early-break behavior; only normal completion forces a final frame. The slow-first-request fixture is explicitly a standalone plaintext fake-peer test, regardless of the surrounding environment. Keeping it in the common adapter ensures it runs in ordinary test discovery; repeated matrix execution is not evidence of TLS/cluster coverage. The separate interaction probes exercise actual TLS/abstract backlog with hidden samples and live metrics. I am not claiming the fake-peer repeats as additional transport coverage. I retained the single renderer gate for a clear sampling/rendering boundary. The remaining completion alias was removed in2ceba05; help/man now distinguish separate error diagnostics from counters inside progress frames. The independent maintainer recheck confirms completion, CLI names and generated documentation agree. All seven review lenses now converge; full final-head CI remains required. |
|
CI follow-up: the TSAN plaintext job failed only the hidden-latency fixture (final p100 0.439 ms versus the expected >200 ms); no ThreadSanitizer race was reported. A single early delayed request can fall out of the worker's per-second live histogram before a late supervisor snapshot. Test-only commit 2e9eacd now supplies slow samples across several hidden ticks, while retaining the final-frame latency and exact operation-count assertions. All six tests pass locally. Independent mutation/repetition checks and fresh full CI are required before merge; runtime code is unchanged. |
|
Reply to the review edited at 08:24:42 UTC: The retry The mechanical enclosing render gate is retained to keep one policy boundary; extracting the entire rendering block would add a larger refactor and many live-stat arguments. The help/man detail is also retained so the distinction between display cadence and supervision/sampling is visible without consulting the README. The test has since been strengthened: a single early slow request was timing-sensitive under TSAN because the worker can reset its per-second live histogram before the first supervisor snapshot. Test-only head2e9eacd supplies slow requests across several hidden ticks. An independent ASan/LSan/UBSan follow-up passed7 exact/correct-runtime cases, including1500ms/2200ms delays before the first supervisor tick; all3 faulty accumulation variants were rejected. The old fixture failed under the same1500ms delay with correct runtime, confirming the fixture defect. No production code changed. All six committed tests pass locally; fresh fullCI remains required before merge. |
|
thank you! |
Problem
Long-running stress tests can produce more progress output than operators need.
--progress-interval=5now renders progress every five seconds, with a final update on normal completion. The default remains one second, and connection errors and other diagnostics retain their existing behavior.Root cause
The original proposal changed the sleep in the main supervision loop. That loop now also enforces connection-stage deadlines, responds to interruption, and publishes live metrics and CPU samples, so changing its sleep would delay unrelated work.
Fix
Use a monotonic clock to gate only progress rendering, for both the normal and
--realtime-latenciesdisplays. Supervision, StatsD/Prometheus exports, CPU sampling, and latency histogram accumulation continue at their existing cadence. Instantaneous values still describe the most recent sample; average percentiles retain samples from hidden ticks. Each run has its own display timer, and normal completion renders its final frame even when the requested interval has not elapsed.Accept positive whole seconds from 1 through
UINT_MAX; zero, negative, fractional, malformed, and overflowing values fail during argument parsing. This is a new option, so zero has no released compatibility contract. Help, the man page, README, shell completion,--show-config, and the additive JSON configuration fieldprogress_intervaldocument the setting. Error suppression remains outside this feature's scope, as discussed in the original author response.The branch preserves the original contribution and merges current master, including #257 and its already-merged fork CI prerequisite. The new setting is long-only: its name describes an interval in seconds and leaves the
-fshort option unassigned.Tests
Affected versions
This adds an optional display setting; no released memtier version implements
--progress-interval, so there is no released bug introducer or backport range. The one-second default preserves existing behavior.Note
Low Risk
New optional output throttle with a 1-second default; core supervision and metrics paths are intentionally unchanged aside from display gating.
Overview
Adds
--progress-interval=SECONDSso operators can throttle how often stderr progress is rendered (default 1 second, unchanged behavior). The supervisor loop still wakes every second; only display of the single-line progress line and--realtime-latenciesblocks is gated with a monotonic clock, while StatsD/Prometheus exports, CPU sampling, timeouts, and per-second latency histogram accumulation keep their existing cadence. A final progress frame is still printed on normal completion (including when the interval is very large or across--run-countruns).The option is validated as a positive whole second up to
UINT_MAX, surfaced in--show-config, JSONprogress_interval, help/man/README, and bash completion. Integration tests cover validation, throttling for both display modes, unchanged metrics sampling, and realtime latency samples from ticks that were not printed.Reviewed by Cursor Bugbot for commit 2e9eacd. Bugbot is set up for automated code reviews on this repo. Configure here.
Test-only follow-up
2e9eacdreplaces a timing-sensitive single slow request with slow samples spanning multiple hidden ticks. All six committed tests pass. Independent sanitizer checks pass seven positive scheduling cases and reject three accumulation mutants; the original fixture fails under an injected startup delay with correct runtime. Runtime code is unchanged; final CI is required.🤖 Generated with Claude Code