Files
Shu Chen 803daf90e1 fix(bench): measure query cache hits per timed section, not across index deletes
Review follow-up for #3020. xerj_query_cache_hits on /v1/metrics is not a
process-lifetime counter: native.rs sets the gauge from
Engine::query_cache_totals(), a sum of per-Index counters over the indexes
open at scrape time, so it drops when an index is deleted. bench-matrix.mjs
deletes /perf before each ingest, the read seed and the mixed load, and
/perfvec before kNN, so a whole-run start/end difference dropped the read
phase's hits under --mixed and could go to 0 or below on a second run against
the same node, which the report then printed as "0 responses served from
cache".

The counter is now read right before and right after each timed read family,
kNN probe loop and mixed op (after setup, before any later DELETE), and the
per-section differences are added. A missing reading or a negative difference
marks that section "not measured" in the log and in SCORECARD.md, never 0.

The comments in bench-matrix.mjs and lib/repro.sh, CONTRIBUTING.md and
scripts/bench/README.md now say the counter is per index and that a deleted
index's hits are gone.

Checked with a copy of bench-matrix.mjs that differs only in CORPUS and
SCRATCH (both are machine-specific absolute paths in the harness): two
--reads-only runs on one cache-on node report 97,020 cached responses each
(before this change the second run's start/end difference could be 0 or
negative); a cache-off node reports 0 over 82 measured sections; sections
during which the node died report "not measured".
2026-11-17 15:53:38 -05:00
..