Skip to content

Commit a16db3a

Browse files
committed
Fix incorrect tps number calculation in "excluding connections establishing".
The tolerance (larger than actual tps number) increases as the number of threads decreases. The bug has been there since the thread support was introduced in 9.0. Because back patching introduces incompatible behavior changes regarding the tps number, the fix is committed to master and 9.5 stable branches only. Problem spotted by me and fix proposed by Fabien COELHO. Note that his original patch included more than fixes (a code re-factoring) which is not related to the problem and I omitted the part.
1 parent 6b61955 commit a16db3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bin/pgbench/pgbench.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2616,7 +2616,7 @@ printResults(int ttype, int64 normal_xacts, int nclients,
26162616
time_include = INSTR_TIME_GET_DOUBLE(total_time);
26172617
tps_include = normal_xacts / time_include;
26182618
tps_exclude = normal_xacts / (time_include -
2619-
(INSTR_TIME_GET_DOUBLE(conn_total_time) / nthreads));
2619+
(INSTR_TIME_GET_DOUBLE(conn_total_time) / nclients));
26202620

26212621
if (ttype == 0)
26222622
s = "TPC-B (sort of)";

0 commit comments

Comments
 (0)