[COMMITTERS] pgsql: Avoid assuming that instr_time == struct timeval in pgbenchlogg

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Avoid assuming that instr_time == struct timeval in pgbenchlogg
Дата
Msg-id E1cNmZG-0005GY-Rm@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Avoid assuming that instr_time == struct timeval in pgbench logging.

This code was presuming undue familiarity with the contents of the
instr_time struct.  That was already broken on Windows, and it's about
to get broken on most other platforms as well.  The simplest solution
that preserves the current output definition is to just do our own
gettimeofday() call here.  Realistically, the extra cost is probably
negligible in comparison to everything else that's going on in a
pgbench transaction, so it's not worth sweating over.

On Windows, the precision delivered by gettimeofday() is lower than
one could wish, but this is still a big improvement over printing
zeroes, as the code did before.

Discussion: https://postgr.es/m/8837.1483216839@sss.pgh.pa.us

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/74baa1e3b89c1651ade1afeffc715cac24041e2f

Modified Files
--------------
src/bin/pgbench/pgbench.c | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: [COMMITTERS] pgsql: Silence compiler warning
Следующее
От: Tom Lane
Дата:
Сообщение: [COMMITTERS] pgsql: In pgbench logging,avoid assuming that instr_times match Unix t