pgsql: pgbench: Improve time logic.

Started by Thomas Munroover 5 years ago2 messagescomitters
Jump to latest
#1Thomas Munro
thomas.munro@gmail.com

pgbench: Improve time logic.

Instead of instr_time (struct timespec) and the INSTR_XXX macros,
introduce pg_time_usec_t and use integer arithmetic. Don't include the
connection time in TPS unless using -C mode, but report it separately.

Author: Fabien COELHO <coelho@cri.ensmp.fr>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Discussion: /messages/by-id/20200227180100.zyvjwzcpiokfsqm2@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/547f04e7348b6ed992bd4a197d39661fe7c25097

Modified Files
--------------
doc/src/sgml/ref/pgbench.sgml | 39 ++--
src/bin/pgbench/pgbench.c | 407 ++++++++++++++++-------------------
src/include/portability/instr_time.h | 28 +++
src/tools/pgindent/typedefs.list | 1 +
4 files changed, 231 insertions(+), 244 deletions(-)

#2Michael Paquier
michael@paquier.xyz
In reply to: Thomas Munro (#1)
Re: pgsql: pgbench: Improve time logic.

Hi Thomas,

On Wed, Mar 10, 2021 at 04:52:01AM +0000, Thomas Munro wrote:

pgbench: Improve time logic.

Instead of instr_time (struct timespec) and the INSTR_XXX macros,
introduce pg_time_usec_t and use integer arithmetic. Don't include the
connection time in TPS unless using -C mode, but report it separately.

The buildfarm is complaining after this commit with lapwing:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=lapwing&amp;dt=2021-03-10%2006%3A40%3A10
pgbench.c:3569:6: error: format '%ld' expects argument of type 'long
int', but argument 6 has type 'pg_time_usec_t' [-Werror=format]
--
Michael