Re: pgbench -i progress output on terminal

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench -i progress output on terminal
Date: 2019-12-04 06:10:55
Message-ID: CA+HiwqHNoyfSfB0z1M6R45+MtVHyoHBU0DZdLMC4ZYfCv8wjNQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 4, 2019 at 11:35 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Tue, Dec 03, 2019 at 10:30:35AM +0900, Amit Langote wrote:
> > How about adding a function, say print_progress_to_stderr(const char
> > *fmt,...), exposed to the front-end utilities and use it from
> > everywhere? Needless to say that it will contain the check for whether
> > stderr points to terminal or a file and print accordingly.
>
> I have considered this point, but that does not seem worth the
> complication as each tool has its own idea of the log output, its own
> idea of the log output timing and its own idea of when it is necessary
> to print the last newline when finishing to the output with '\r'.

Okay, seems more trouble than worth to design around all that.

> > Considering Fabien's comment on this, we will have to check which
> > other instances are printing information that is not very useful to
> > look at line-by-line.
>
> Thanks, applied the part for the initialization to HEAD. I got to
> think about Fabien's point and it is true that for pgbench's
> --progress not keeping things on the same line for a terminal has
> advantages because the data printed is not cumulative: that's a
> summary of the previous state printed which can be compared.
>
> Note: the patch works on Windows, no problem.

Thanks for checking and committing the patch.

Regards,
Amit

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-12-04 06:16:25 Re: Proposal: Add more compile-time asserts to expose inconsistencies.
Previous Message Michael Paquier 2019-12-04 05:48:16 Re: Using XLogFileNameP in critical section