summaryrefslogtreecommitdiff
path: root/contrib/pgbench/pgbench.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2016-09-21 13:14:48 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2016-09-21 13:16:24 +0300
commitf16d4a241594bb198e1abedb5e43977ef796370a (patch)
tree5a8a438d053755747b710879b239f5a1517dd994 /contrib/pgbench/pgbench.c
parent431a056271ff525661e85c781f817b3036c6e263 (diff)
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>
Diffstat (limited to 'contrib/pgbench/pgbench.c')
-rw-r--r--contrib/pgbench/pgbench.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index 807d7dcdb8d..ee2df8fb33c 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -2353,9 +2353,9 @@ printResults(int ttype, int64 normal_xacts, int nclients,
}
else
{
- /* only an average latency computed from the duration is available */
+ /* no measurement, show average latency computed from run time */
printf("latency average: %.3f ms\n",
- 1000.0 * duration * nclients / normal_xacts);
+ 1000.0 * time_include * nclients / normal_xacts);
}
if (throttle_delay)