pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Subject: pgbench - compute & show latency consistently
Date: Sat, 9 Jul 2016 10:42:27 +0200 (CEST)
Message-ID: <alpine.DEB.2.20.1607091035530.3412@sto> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


Currently the latency is not computed and displayed consistently:

  - the computation is wrong under -t (duration is zero...)

  - depending on the conditions it is shown with a ":" syntax or
    a "=" syntax.

The attached minor patch makes the computation & display more consistent.

-- 
Fabien.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

pgbench-latency-t-1.patch (text/x-diff, 1.7K) download diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index f3afedb..26c030e 100644 --- a/doc/src/sgml/ref/pgbench.sgml +++ b/doc/src/sgml/ref/pgbench.sgml @@ -1254,8 +1254,8 @@ number of clients: 10 number of threads: 1 number of transactions per client: 1000 number of transactions actually processed: 10000/10000 -latency average = 15.844 ms -latency stddev = 2.715 ms +latency average: 15.844 ms +latency stddev: 2.715 ms tps = 618.764555 (including connections establishing) tps = 622.977698 (excluding connections establishing) script statistics: diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 87fb006..6eb9f28 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -3237,8 +3237,8 @@ printSimpleStats(char *prefix, SimpleStats *ss) double latency = ss->sum / ss->count; double stddev = sqrt(ss->sum2 / ss->count - latency * latency); - printf("%s average = %.3f ms\n", prefix, 0.001 * latency); - printf("%s stddev = %.3f ms\n", prefix, 0.001 * stddev); + printf("%s average: %.3f ms\n", prefix, 0.001 * latency); + printf("%s stddev: %.3f ms\n", prefix, 0.001 * stddev); } /* print out results */ @@ -3291,9 +3291,9 @@ printResults(TState *threads, StatsData *total, instr_time total_time, if (throttle_delay || progress || latency_limit) printSimpleStats("latency", &total->latency); else - /* only an average latency computed from the duration is available */ + /* no measure, show average latency computed from run time */ printf("latency average: %.3f ms\n", - 1000.0 * duration * nclients / total->cnt); + 1000.0 * time_include * nclients / total->cnt); if (throttle_delay) {

view thread (9+ messages)  latest in thread

Message-ID: <alpine.DEB.2.20.1607091035530.3412@sto>
Permalink:  ../alpine.DEB.2.20.1607091035530.3412@sto/
Also on:    postgresql.org/message-id/alpine.DEB.2.20.1607091035530.3412@sto

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: coelho@cri.ensmp.fr
  Subject: Re: pgbench - compute & show latency consistently
  In-Reply-To: <alpine.DEB.2.20.1607091035530.3412@sto>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox