Re: pgbench stats per script & other stuff

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2016-02-08T19:22:32Z
Lists: pgsql-hackers

Attachments

Hello Michaël,

> +       /* compute total_weight */
> +       for (i = 0; i < num_scripts; i++)
> +       {
> +               total_weight += sql_script[i].weight;
> +
> +               /* detect overflow... */
> If let as int64, you may want to remove this overflow check, or keep
> it as int32.

I'd rather keep int64, and remove the check.

>> [JSON/YAML]
>> If you want something else, it would help to provide a sample of what you
>> expect.
>
> You could do that with an additional option here as well:
> --output-format=normal|yamljson. The tastes of each user is different.

I think that json/yaml-ifying pgbench output is beyond the object of this
patch, so should be kept out?

>        const char *name;
> +       int                     weight;
>        Command   **commands;
> -       StatsData stats;
> +       StatsData       stats;
> Noise here?

Indeed.

>> Find attached a 18-d which addresses these concerns, and a actualized 18-e
>> for the prefix.
>
> (I could live without that personally)

Hmmm, I type them and I'm not so good with a keyboard, so "se" is better 
than:

"selct-only<back-back-back-back-back-back-back-back>ect-only".

> -/* return builtin script "name", or fail if not found */
> +/* return commands for selected builtin script, if unambiguous */
> static script_t *
> findBuiltin(const char *name)
> This comment needs a refresh. This does not return a set of commands,
> but the script itself.

Indeed.

Attached 19-d and 19-e.

-- 
Fabien.

Commits

  1. pgbench: Allow changing weights for scripts