Re: pgbench stats per script & other stuff - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: pgbench stats per script & other stuff
Date
Msg-id alpine.DEB.2.10.1507211626000.30948@sto
Whole thread Raw
In response to Re: pgbench stats per script & other stuff  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: pgbench stats per script & other stuff  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hello Robert,

> On Fri, Jul 17, 2015 at 9:50 AM, Fabien <coelho@cri.ensmp.fr> wrote:
>>   sh> ./pgbench -T 3 -B -N -w 2 -S -w 7 --per-script-stats
>
> That is a truly horrifying abuse of command-line arguments.  -1 from
> me, or minus more than one if I've got that many chits to burn.

Are you against the -w, or against saying that pgbench execute scripts, 
whether internal or from files?

The former is obviously a matter of taste and I can remove "-w" if nobody 
wants it, too bad because the feature seems useful to me from a testing 
point of view, this is a choice between aesthetic and feature. Note that 
you do not have to use it if you do not like it.

The later really homogeneise the code internally and allows to factor out 
things, to have orthogonal features (internal scripts are treated the same 
way as external files, this requires less lines of code because it is 
simpler), and does not harm anyone IMO, so it would be sad to let it go.

> I have been thinking that the way to do this is to push more into the
> script file itself, e.g. allow:
>
> \if random() < 0.1
> stuff
> \else
> other stuff
> \endif
>
> Maybe that's overkill and there's some way of specifying multiple
> scripts on the command line, but IMO what you've got here is not it.

I think that is overkill, and moreover it is not useful: the point is to 
collect statistics *per scripts*, with an "random if" you would not know 
which part was executed, so you would loose the whole point of having per 
script stats.

If you have another suggestion about how to provide weights, which does 
not rely on ifs nor on options? Maybe a special comment in the script (yuk 
from my point of view because the script would carry its weight whereas I 
think this should be orthogonal to the script contents, but it would be 
better than nothing..).

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Paul Ramsey
Date:
Subject: Re: [PATCH] postgres_fdw extension support
Next
From: Andres Freund
Date:
Subject: Re: [PATCH] postgres_fdw extension support