Re: Specifying the log file name of pgbench -l option

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Specifying the log file name of pgbench -l option
Date: 2016-11-01 17:38:03
Message-ID: CAD21AoDQX8MUpuog+mX9V0KB0Op9d0MBL+xBJC_Np4ZMM_8sSg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 2, 2016 at 1:41 AM, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:
>
>> The log file generated by pgbench -l option is fixed file name
>> 'pgbench_log.<pid>.<thread id>'. And it's a little complicated for the
>> script that runs pgbench repeatedly to identify the log file name.
>> Attached patch make it possible to specify the log file name. I think
>> it's useful for the use who want to run pgbench repeatedly in script
>> and collects and analyze the result.
>>
>> The one thing I concern is that this patch changes -l option so that
>> it requires argument.
>> But changing its behavior would be good rather than adding new option.
>>
>> Please give me feedback.
>
>
> Patch applies but does not compile, because "logfilename" is not declared.
> I guess "logfile" was meant instead.
>
> I understand and agree that in some case having only a predefined file
> prefix in the current directory as the only option can be a hindrance for
> scripts which use pgbench and rely on the log.
>
> I'm not at ease either with changing the behavior of such an option, as some
> people may be happy with it and some script may be using it. I would suggest
> not to do so.
>
> Moreover, what is provided is not a file name, but a prefix used to build
> file names.
>
> So I would suggest to:
> - fix the compilation issue
> - leave -l/--log as it is, i.e. use "pgbench_log" as a prefix
> - add --log-prefix=... (long option only) for changing this prefix
>

Thank you for reviewing this patch!

I agree. It's better to add the separated option to specify the prefix
of log file instead of changing the existing behaviour. Attached
latest patch incorporated review comments.
Please review it.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
pgbench_log_file_name_v2.patch application/x-patch 4.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-11-01 17:44:19 Re: Declarative partitioning - another take
Previous Message Robert Haas 2016-11-01 17:34:05 Re: Declarative partitioning - another take