Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akxuP-0002lU-FV for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Mar 2016 17:58:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1akxuP-0007LE-1x for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Mar 2016 17:58:29 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1akxuO-0007L8-4s for pgsql-hackers@postgresql.org; Tue, 29 Mar 2016 17:58:28 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1akxuG-0008Mo-LF for pgsql-hackers@postgresql.org; Tue, 29 Mar 2016 17:58:26 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.83.202.40]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id A875F400FA9; Tue, 29 Mar 2016 10:58:19 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 349375B0; Tue, 29 Mar 2016 14:58:17 -0300 (CLT) Date: Tue, 29 Mar 2016 14:58:17 -0300 From: Alvaro Herrera To: Fabien COELHO Cc: Jeff Janes , PostgreSQL Developers Subject: Re: pgbench stats per script & other stuff Message-ID: <20160329175817.GA883652@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160329175516.GA881582@alvherre.pgsql> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Alvaro Herrera wrote: > In doing this, I noticed that the latency output is wrong if you use -T > instead of -t; it always says the latency is zero because "duration" is > zero. I suppose it should be like in the attached instead. At the same > time, it says "latency average: XYZ" instead of "latency average = XYZ" > as in printSimpleStats, which doesn't look terribly important. But the > line appears in the SGML docs. Patch actually attached here. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --uAKRQypu60I7Lcqm Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pgbench-latency.patch" diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 52d1223..5cb5906 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -3152,10 +3152,13 @@ printResults(TState *threads, StatsData *total, instr_time total_time, if (throttle_delay || progress || latency_limit) printSimpleStats("latency", &total->latency); - else + else if (duration > 0) /* only an average latency computed from the duration is available */ - printf("latency average: %.3f ms\n", + printf("latency average: %.3f ms", 1000.0 * duration * nclients / total->cnt); + else + printf("latency average: %.3f ms", + 1000.0 * time_include * nclients / total->cnt); if (throttle_delay) { --uAKRQypu60I7Lcqm Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --uAKRQypu60I7Lcqm--