diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2016-09-21 13:14:48 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2016-09-21 13:16:20 +0300 |
commit | b93d37474fdf31d2cd71c13f014b481863abb7c2 (patch) | |
tree | 9ba6622e16e3fbc076b5bff89e5a25818fb6187d /src | |
parent | 923ad1a16ae2b399e78447581b9de65a0e2a439a (diff) | |
download | postgresql-b93d37474fdf31d2cd71c13f014b481863abb7c2.tar.gz postgresql-b93d37474fdf31d2cd71c13f014b481863abb7c2.zip |
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 'src')
-rw-r--r-- | src/bin/pgbench/pgbench.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 75dc57d360c..60a5af8a9ba 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -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) |