Skip to content

Report actual WAIT latency in JSON summaries - #805

Merged
fcostaoliveira merged 2 commits into
masterfrom
codex/fix803-wait-json-latency-20261023
Oct 23, 2026
Merged

fcostaoliveira merged 2 commits into
masterfrom
codex/fix803-wait-json-latency-20261023

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Built-in WAIT operations have real latency samples, but their JSON Latency, Average Latency and Accumulated Latency are always zero. A reproduced run has7 WAIT operations, a97.60914ms text mean and80.384–100.863ms JSON min/max while all three summary fields are zero. Aggregate Totals accumulated latency also omits WAIT because it sums the serialized command rows.

Root cause

The Waits call to result_print_to_json() supplies literal zeros for the latency and accumulated latency arguments. The counters and WAIT histogram already contain the actual data.

Fix

Pass m_wait_cmd.m_latency and m_wait_cmd.m_total_latency through the existing writer and aggregate row_latency() helper. Real runs expose their measured values; aggregate accumulated latency keeps the existing rounded per-run convention, and Totals remains the sum of its rows. Empty WAIT rows remain zero. No keys, types, execution behavior, counters, rates, text output or HDR data change.

This is independent of#804/#671's sample-weighted aggregate calculation. It uses the current aggregate mean, and composes with that correction without changing either scope.

Tests

  • New real Redis JSON regressions cover a populated single run, two runs with individual/BEST/WORST/aggregate output, and a zero-WAIT control. Cross-check summary accumulated latency against actual per-second samples, both mean aliases, count averaging, aggregate Totals sums and empty fields.
  • Basebc8d69b: 10 WAIT assertions fail; zero-WAIT control passes. Fixed: 2/2 functions pass in7seconds.
  • Both functions also pass over authenticated TLS in7seconds; populated WAIT is standalone-only because the CLI rejects --wait-ratio in cluster mode. Final cluster validation skips that unsupported case and passes the default zero-WAIT control.
  • The final aggregate-mean oracle rejects a positive-but-halved mean mutation; zero mean, zero accumulation and double-divided aggregate accumulation mutations also fail. Final standalone regressions pass2/2 in7seconds.
  • 17/17 unit programs pass, along with staged C++ formatting and source whitespace checks.
  • Independent#804 composition checks the two changes together with#801 retry counters; exact-head CI and seven-lens reviews remain merge gates.

Affected versions

Introduced by d6bc71fdb1fa7a71f85c9b6fc0e9541ff4f36d7c (#273), which replaced the HDR-derived mean with a passed latency and introduced accumulated latency, but supplied zeros for WAIT. Its parent calculated the mean from the WAIT histogram. git tag --contains lists 2.1.2–2.5.2, plus current master. Historical release attribution is from source/tag history; historical binaries were not executed.

Release note — Bug Fixes

Correct built-in WAIT latency and accumulated latency in JSON summaries, including WAIT's contribution to aggregate Totals accumulated latency. Previously these populated WAIT fields were zero. Empty WAIT rows and all JSON keys/types are unchanged.

Fixes #803.

🤖 Generated with Claude Code

@fcostaoliveira
fcostaoliveira merged commit eb9a8e3 into master Oct 23, 2026
139 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.

Built-in WAIT JSON latency and accumulated latency are always zero

1 participant