]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix pgbench's calculation of average latency, when -T is not used.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 21 Sep 2016 10:14:48 +0000 (13:14 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 21 Sep 2016 10:16:20 +0000 (13:16 +0300)
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>

src/bin/pgbench/pgbench.c

index 75dc57d360c5917bf3c635a7228ab4db7ddcc750..60a5af8a9ba9052bfb485bc565b9c167467a5e00 100644 (file)
@@ -2736,9 +2736,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)