Skip to content

Commit b93d374

Browse files
committed
Fix pgbench's calculation of average latency, when -T is not used.
If the test duration was given in # of transactions (-t or no option), rather as a duration (-T), the latency average was always printed as 0. It has been broken ever since the display of latency average was added, in 9.4. Fabien Coelho Discussion: <alpine.DEB.2.20.1607131015370.7486@sto>
1 parent 923ad1a commit b93d374

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/pgbench/pgbench.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,9 +2736,9 @@ printResults(int ttype, int64 normal_xacts, int nclients,
27362736
}
27372737
else
27382738
{
2739-
/* only an average latency computed from the duration is available */
2739+
/* no measurement, show average latency computed from run time */
27402740
printf("latency average: %.3f ms\n",
2741-
1000.0 * duration * nclients / normal_xacts);
2741+
1000.0 * time_include * nclients / normal_xacts);
27422742
}
27432743

27442744
if (throttle_delay)

0 commit comments

Comments
 (0)