Repository navigation
Tighten realtime-latency sample thresholds and window tests - #824
Conversation
percentile_min_samples now snaps 100/(100-p) only when it lies within the parsing error of p of the value the user meant, and otherwise rounds up, so p99.99991 needs 1111112 samples and p99.9999999999 needs 1e12. The run warning no longer says "about" for the exact --requests bound. Document that the cluster bound comes from the first topology. Assert that a rate-limited window run prints exactly one percentile warning, which catches a cluster run that also applies the pre-run check without the endpoint fan-out. Rename the window-row test to what it checks, and fix the README example spacing and line wrap and a split help string. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. Thanks for following up on #386. I went through it and only have two small comments. I worked through the new
The new single-warning assertion in the rate-limit test is a nice catch, especially since you checked that it fails on the cluster mutant. The fix looks right to me; I'd just like the rounding behavior pinned by a test before this merges. (would file this as a comment, not a formal block) |
Add test_percentile_sample_thresholds, which checks the warning for p99.9, p99.97, p99.9999, p99.99991 and 12 nines against the exact ceil(100 / (100 - p)); the old 7-digit snapping fails it (1111111 for p99.99991). The Python helper now computes the threshold exactly from the printed percentile. Print percentiles in the realtime rows and warnings with %.15g, so 12 nines no longer display as p100. Rejoin the help string, note that the error bound is doubled for margin, and make the window-row test's docstring match what it asserts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks. Both points are addressed in
|
Follow-up to #386 with the review points left for after the merge.
Problem
percentile_min_samples()snapped every value to at most 7 significant digits. That made all-nines percentiles exact, but other percentiles came out slightly off: p99.99991 gave 1111111 instead of 1111112, p99.99999993 came out 28571 too high, and p99.9999999999 gave 999999999999 instead of 1e12.--requests, where N is exact.test_latency_window_ring_smooths_spikesdidn't test smoothing. The README example's spacing didn't match the real output, and one help string was split in an odd place.Fix
100/(100-p)snaps to the intended value only when it lies within the error from parsing p as a double: at most half an ulp of 100, amplified by100/(100-p). Otherwise it rounds up. The rounding uses an integer power of ten, so it is exact.--requestsbound drops "about"; the approximate rate-limit bound keeps it.warning: p99.9 needsline is printed.test_latency_window_row_reports_values. The README example now matches the real column layout, and the help string is rejoined.Tests
make check: 18/18.make format-checkis clean.test_realtime_latencies.py8/8 andtest_progress_interval.py6/6, standalone. memtier authenticated against a password-protected server, with no NOAUTH replies.Affected versions
Only #386 code, merged as 9bf3960. No release tag contains it.
🤖 Generated with Claude Code
Note
Low Risk
Changes only benchmark reporting thresholds, stderr warnings, and tests for
--realtime-latencies; no runtime request path or server interaction.Overview
Tightens how
--realtime-latenciesdecides when a percentile is “resolved” and aligns warnings/output with that logic.percentile_min_samples()no longer snaps every value to seven significant digits. It now treatsceil(100/(100-p))as the intended threshold when double parsing error allows (e.g. p99.9999 → 1e6, p99.9999999999 → 1e12), and rounds up otherwise (e.g. p99.99991 → 1111112). Pre-run warnings and live*marking still use this helper; run-bound messages drop “about” for exact--requestscaps, print percentiles with%.15g, and document that cluster rate-limit bounds come from the first topology only.Docs/help get minor fixes (README example column spacing,
--realtime-latencieshelp wrap). Tests addtest_percentile_sample_thresholds, simplify the latency-window row test, match exact--requestswarning text, and assert only onep99.9window warning in cluster runs.Reviewed by Cursor Bugbot for commit dad8544. Bugbot is set up for automated code reviews on this repo. Configure here.