Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5515ec0

Browse files
committed
Fix calculation of latency of pgbench backslash commands.
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.
1 parent a293228 commit 5515ec0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bin/pgbench/pgbench.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1135,11 +1135,12 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
11351135
* first time it's needed, and reuse the same value throughout this
11361136
* function after that. This also ensures that e.g. the calculated latency
11371137
* reported in the log file and in the totals are the same. Zero means
1138-
* "not set yet".
1138+
* "not set yet". Reset "now" when we step to the next command with "goto
1139+
* top", though.
11391140
*/
1141+
top:
11401142
INSTR_TIME_SET_ZERO(now);
11411143

1142-
top:
11431144
commands = sql_files[st->use_file];
11441145

11451146
/*

0 commit comments

Comments
 (0)