Hi hackers! While working on [1] or [2] I sometimes use pgbench in short-run mode: see if there is some performance improvements or degradation for 5-10 seconds, press CTRL+C, make some code changes and repeat the measurements.
For now, pgbench prints nothing on CTRL+C, which hides the run statistics from user. What if it printed the collected statistics anyway, along with the existing 'Run was aborted; the above results are incomplete.' message? Attached POC-patch does: - on first SIGINT stops accepting new transactions, discards the in-flight ones and print the summary as usual, exiting with status 130 - on second SIGINT fallbacks to standard handler immediately - caps all wait at one second, so the SIGINT can interrupt the \sleep For now I am not sure about exit code.. Any feedback would be appreciated :) [1] - https://github.com/yandex/odyssey [2] - https://github.com/pg-sharding/spqr/ -- Best regards, Roman Khapov
0001-pgbench-print-partial-results-on-SIGINT.patch
Description: Binary data
