Skip to content

Fire default-workload GET miss-rate warning for --run-count AVERAGE - #586

Merged
fcostaoliveira merged 2 commits into
masterfrom
fix/run-count-miss-warning
Oct 14, 2026
Merged

fcostaoliveira merged 2 commits into
masterfrom
fix/run-count-miss-warning

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

With --run-count > 1 and the default SET/GET workload, the GET miss-rate warning never fires for the AGGREGATED AVERAGE RESULTS section. On an empty DB, -t 1 -c 2 -n 2000 --ratio 0:1 --run-count 2 prints 3 results sections but only 2 warnings (BEST and WORST).

Root cause

The default-workload branch of the warning in run_stats::print() reads m_totals.m_hits / m_totals.m_misses. For a single run these are live counters. aggregate_average() builds the AVERAGE totals from summarize() + totals::add(), and summarize() never fills m_hits / m_misses, so the AVERAGE object always has 0 / 0. print() skips summarize() for it, so nothing fills them later, and the warning is skipped because total == 0.

Fix

In aggregate_average(), right after summarize() + add(), add each run's m_totals.m_hits / m_misses to the AVERAGE totals. This mirrors how the per-run latency histogram is already merged explicitly there. The counts are summed across runs, matching how m_arbitrary_misses is handled for the --command path, so the AVERAGE warning reads e.g. (8000 misses / 8000 ops) for 2 × 4000.

Only the warning reads these two fields on the AVERAGE object. JSON and the text table use m_hits_sec / m_misses_sec, which are unchanged.

Test evidence

Two tests in test_miss_rate_tracking.py (section 11). Both run on standalone and oss-cluster.

  • test_run_count_average_default_get_miss_warning: empty DB, --ratio=0:1 --run-count=2. Asserts one GET warning per results section. The AVERAGE warning, identified by its summed ops count and print order, must read 100%, 1200 / 1200.
  • test_run_count_average_default_get_partial_miss_rate: 3 of 10 keys preloaded (~70% misses). The AVERAGE warning must equal the server's summed keyspace_hits/keyspace_misses across both runs (e.g. 848 / 1200). With --miss-rate-threshold=95, no section may warn.
Binary standalone oss-cluster (3 shards)
origin/master e4d14e8 both FAIL (AVERAGE warning missing) both FAIL
this branch both PASS; full file 14/14 in 5/5 runs full file 14/14 in 3/3 runs
mutant: hit carry-over deleted partial-hit FAILS (100%, 848 / 848; warns at threshold 95) FAILS
mutant: hits added to misses partial-hit FAILS (1200 / 1200 vs 848 / 1200) FAILS

Manual repro, before / after:

master: 3 sections, 2 warnings (4000/4000, 4000/4000)
fix:    3 sections, 3 warnings (4000/4000, 4000/4000, 8000/8000)

Fixes #585

Affected versions

2.4.0 through 2.5.2 (latest) and master. Introduced by 1485147 (#398), first tag 2.4.0. Confirmed by running on 2.4.0, 2.5.2 and master e4d14e8; 2.1.0 has no such warning. 2.4.1–2.4.4 and 2.5.0–2.5.1 are derived from history.

🤖 Generated with Claude Code


Note

Low Risk
Narrow change to multi-run aggregation for warning-only hit/miss counters; covered by new integration tests.

Overview
Fixes GET miss-rate warnings for the AGGREGATED AVERAGE section when --run-count > 1 on the default SET/GET workload. BEST/WORST already warned; AVERAGE skipped because aggregate_average() never populated m_totals.m_hits / m_misses after summarize() (unlike latency histograms and arbitrary-command miss totals).

run_stats::aggregate_average() now sums each run’s m_totals.m_hits and m_misses into the averaged totals so print()’s default-workload --miss-rate-threshold check sees non-zero ops (e.g. summed misses across runs). JSON/text Hits/sec / Misses/sec are unchanged.

Integration tests in test_miss_rate_tracking.py assert one warning per results section (BEST/WORST/AVERAGE), correct summed counts on AVERAGE for all-miss and partial-hit runs, and no warning when threshold is above the real miss rate.

Reviewed by Cursor Bugbot for commit c307679. Bugbot is set up for automated code reviews on this repo. Configure here.

fcostaoliveira and others added 2 commits October 14, 2026 00:17
The default-workload branch of the miss-rate warning in print() reads
m_totals.m_hits / m_misses. For a single run those are live counters,
but aggregate_average() builds the AVERAGE totals from summarize() +
totals::add(), and summarize() never fills m_hits / m_misses. The
AVERAGE section therefore saw 0 / 0 and never warned, even at 100%
misses, while BEST and WORST did.

Carry each run's GET hit/miss counts into the AVERAGE totals right
after summarize(), the same way the per-run latency histogram is merged
explicitly. They are summed across runs, matching how
m_arbitrary_misses is handled for the --command path.

Fixes #585

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The all-miss workload could not tell hits from misses, so dropping the
hit carry-over or adding hits to misses in aggregate_average() still
passed. Add a partial-hit case (3 of 10 keys preloaded): the AVERAGE
warning must report exactly the server's summed keyspace hits/misses
across both runs, and a threshold above the real miss rate must keep
every section silent, AVERAGE included.

Identify the AVERAGE warning by its summed ops count (and print order)
instead of relying on BEST/WORST covering one run each. The default
workload takes the same path in cluster mode, so the tests run on
oss-cluster too. Move them to their own numbered section and list them
in the module docstring.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@fcostaoliveira
fcostaoliveira merged commit 1ef64ef into master Oct 14, 2026
127 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--run-count: default-workload GET miss-rate warning never fires for AGGREGATED AVERAGE

1 participant