git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a293228)
Fix calculation of latency of pgbench backslash commands.
2015年7月30日 11:50:51 +0000 (14:50 +0300)
2015年7月30日 11:50:51 +0000 (14:50 +0300)
When we loop back to the top of doCustom after processing a backslash
command, we must reset the "now" timestamp, because that's used to
calculate the time spent executing the previous command.

Report and fix by Fabien Coelho. Backpatch to 9.5, where this was broken.


diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 3b8a80fa7ad44f3d0af23b7c68eccbc12448146a..30a59afcce5df9398ebff31129ccb83bd5c97992 100644 (file)
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -1135,11 +1135,12 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
* first time it's needed, and reuse the same value throughout this
* function after that. This also ensures that e.g. the calculated latency
* reported in the log file and in the totals are the same. Zero means
- * "not set yet".
+ * "not set yet". Reset "now" when we step to the next command with "goto
+ * top", though.
*/
+top:
INSTR_TIME_SET_ZERO(now);
-top:
commands = sql_files[st->use_file];
/*
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /