Skip to content

Exclude late completions from concurrent QPS - #1185

Closed
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix-concurrent-qps-deadline
Closed

Exclude late completions from concurrent QPS#1185
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix-concurrent-qps-deadline

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

Count concurrent query outcomes only when the query completes within the configured benchmark window.

Why

Workers currently check the deadline before starting a query, but increment their counters after it finishes regardless of completion time. A query started just before the deadline can finish much later and still be included in concurrent_qps, which is divided by the original fixed duration.

With two workers, a two-second window, and queries that take three seconds, no query completes during the window, but the current code reports 1.000 QPS. After this change both late completions are excluded and the result is null. Workers still finish their in-flight queries normally; this does not introduce client cancellation or leave server-side work behind.

Testing

  • real bench_concurrent_qps probe: late successes produce null QPS
  • real bench_concurrent_qps probe: late failures produce null error ratio
  • real bench_concurrent_qps probe: in-window successes are still counted
  • bash -n lib/benchmark-common.sh
  • shellcheck lib/benchmark-common.sh
  • git diff --check

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.

1 participant