Hello devs,
When \sleep is used within a pgbench script it resets txn_scheduled which
is used for computing stats about the transaction, resulting in absurd
statistics:
latency average = 0.649 ms *** ??? ***
...
script statistics:
- statement latencies in milliseconds:
0.235 BEGIN;
100.301 \sleep 100 ms
0.351 END;
I probably created this bug when adding "--rate" in 9.4 and trying to be
too clever. As nobody complained yet about it, I'm not sure it is worth
fixing it there, though.
The fix is that "\sleep" does not have to interfere with the txn_scheduled
field, see the attached patch.
latency average = 100.237 ms *** BETTER ***
...
script statistics:
- statement latencies in milliseconds:
0.099 BEGIN;
100.001 \sleep 100 ms
0.135 END;
--
Fabien.