pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: pgbench stats per script & other stuff
Date: Mon, 28 Dec 2015 23:29:02 +0100 (CET)
Message-ID: <alpine.DEB.2.10.1512282309280.3689@sto> (raw)
In-Reply-To: <CAB7nPqQVQFXtM_sQPMvF1thU_5YrBxJ_Wgjx=qeA7kzLjnbXnA@mail.gmail.com>
References: <alpine.DEB.2.10.1507220706260.5636@sto>
	<55AFD8C6.8010507@agliodbs.com>
	<CA+TgmobZSBmWzugAQp94=q98c2fmSBc+gRPwfNM+94dhjpL3tg@mail.gmail.com>
	<alpine.DEB.2.10.1507231759400.10585@sto>
	<CA+TgmoZEvNJ8wkVdHCsWnsz8Rz-MHebGp4DY+8WjiU-xYPT6Nw@mail.gmail.com>
	<alpine.DEB.2.10.1507250910540.20046@sto>
	<alpine.DEB.2.10.1507251618230.25082@sto>
	<alpine.DEB.2.10.1507281626330.3538@sto>
	<alpine.DEB.2.10.1507301801500.22793@sto>
	<20150902172617.GJ5286@alap3.anarazel.de>
	<alpine.DEB.2.10.1509030917480.16877@sto>
	<alpine.DEB.2.10.1509260923150.8351@sto>
	<alpine.DEB.2.10.1510030810440.24488@sto>
	<CAB7nPqQV0wHJ4CKw_0YFQbfVahQrw80QfaHRGQw7cgbux7mKCg@mail.gmail.com>
	<alpine.DEB.2.10.1512142131430.22108@sto>
	<CAB7nPqRhA3OrpTpKP4saL5652F7xmoEOfT09th8e8TpRdv=KQA@mail.gmail.com>
	<alpine.DEB.2.10.1512151237030.25544@sto>
	<CAB7nPqQLB89CFhL1jZhROXC0Zyg_nuoD1FVpbf6pMwkAV263Sw@mail.gmail.com>
	<CAB7nPqQVQFXtM_sQPMvF1thU_5YrBxJ_Wgjx=qeA7kzLjnbXnA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


Hello Michaƫl,

>> And then I also had a look at src/port/snprintf.c, where things get
>> actually weird when no transactions are run for a script (emulated
>> with 2 scripts, one with @10000 and the second with @1):
>>  - 0 transactions (0.0% of total, tps = 0.000000)
>>  - latency average = -1.#IO ms
>>  - latency stddev = -1.#IO ms
>> And it seems that this is a bug in fmtfloat() because it does not
>> handle nan values correctly. Others, any thoughts about that?
>> It is possible to address things within your patch by using isnan()
>> and print another message but I think that we had better patch
>> snprintf.c if my analysis is right.
>
> FWIW, I just had a closer look at this portion and I arrived at the
> conclusion that sprintf implementation on Windows is just broken as it
> is not able to handle appropriately inf or nan as exceptions.
> fmtfloat@src/port/snprintf.c relies on the system's implementation of
> sprintf to handle those exceptions, however even directly calling
> sprintf results in the same weird output, inf showing up as "1.#IO"
> and nan as "-1.#IO". Anyone, feel free to disagree if I am missing
> something.

I have no opinion any about M$ implementation of double prettyprinting, 
but I agree that "-1.#IO" looks strange. WWW seems to say that "-1.INF" 
and "-1.IND" are the "normal" way for windows to say infinity or not a 
number. Well, if someone there thought it look good, I cannot help it.

> Still, it would be cool to have better error message when there is no
> value to show up to the user, like "no latency average" or "undefined
> latency average". That would be more elegant, and the patches proposed
> still lack that.

Hmmm. I do not buy that for several reasons:

For --progress style reporting you want NaN or whatever, because the 
output could be processed further unix-style from a pipe (grep/cut/...). 
This is also true for the final report. I would not want to change the 
output organisations for some special values, I would just like to get the 
value whatever it is, "NaN" or "Infinity" or even "-1.IND", so that the 
pipe commands would work.

Also, for the final report, it seems to me overkill to try to work around 
cases when pgbench does not run any transactions, which is basically not 
often, as the point is to run many transactions.

Finally this behavior already exists, the patch does not change anything 
AFAICS, and it is not its purpose.

So I would suggest to keep it that way.

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



view thread (92+ messages)  latest in thread

Message-ID: <alpine.DEB.2.10.1512282309280.3689@sto>
Permalink:  ../alpine.DEB.2.10.1512282309280.3689@sto/
Also on:    postgresql.org/message-id/alpine.DEB.2.10.1512282309280.3689@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, michael.paquier@gmail.com
  Subject: Re: pgbench stats per script & other stuff
  In-Reply-To: <alpine.DEB.2.10.1512282309280.3689@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