Re: pgbench stats per script & other stuff

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Michael Paquier <michael.paquier@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2016-03-04T17:31:59Z
Lists: pgsql-hackers

Attachments

Hello Alvaro,

> I looked at 19.d and I think the design has gotten pretty convoluted.  I
> think we could simplify with the following changes:
>
> struct script_t gets a new member, of type Command **, which is
> initially null.
>
> function process_builtin receives the complete script_t (not individual
> memebers of it) constructs the Command ** array and puts it in
> script_t's new member; return value is the same script_t struct it got
> (except it's now augmented with the Command **array).
>
> function process_file constructs a new script_t from the string list,
> creates its Command **array just like process_builtin and returns the
> constructed struct.
>
> function addScript receives script_t instead of individual members of
> it, and does the appropriate thing.

Why not. Here are two versions:

   *-20.patch is the initial rebased version

   *-21.patch does what you suggested above, some hidden awkwardness
      but much less that the previous one.

-- 
Fabien

Commits

  1. pgbench: Allow changing weights for scripts