]> granicus.if.org Git - postgresql/commit
In pgbench logging, avoid assuming that instr_times match Unix timestamps.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 2 Jan 2017 17:26:03 +0000 (12:26 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 2 Jan 2017 17:26:03 +0000 (12:26 -0500)
commit67a875355e4a6db294e9652af5a883876ddeb4a5
tree756d2ca1993a0606cd906212cb114901b5f68a52
parent74baa1e3b89c1651ade1afeffc715cac24041e2f
In pgbench logging, avoid assuming that instr_times match Unix timestamps.

For aggregated logging, pg_bench supposed that printing the integer part of
INSTR_TIME_GET_DOUBLE() would produce a Unix timestamp.  That was already
broken on Windows, and it's about to get broken on most other platforms as
well.  As in commit 74baa1e3b, we can remove the entanglement at the price
of one extra syscall per transaction; though here it seems more convenient
to use time(NULL) instead of gettimeofday(), since we only need
integral-second precision.

I took the time to do some wordsmithing on the documentation about
pgbench's logging features, too.

Discussion: https://postgr.es/m/8837.1483216839@sss.pgh.pa.us
doc/src/sgml/ref/pgbench.sgml
src/bin/pgbench/pgbench.c