Re: pgbench -i progress output on terminal

2019-12-03 Thread Amit Langote
On Wed, Dec 4, 2019 at 11:35 AM Michael Paquier 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

Re: pgbench -i progress output on terminal

2019-12-03 Thread Michael Paquier
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

Re: pgbench -i progress output on terminal

2019-12-03 Thread Fabien COELHO
Attached v4. Patch applies cleanly, compiles, works for me. Put it back to ready. -- Fabien.

Re: pgbench -i progress output on terminal

2019-12-02 Thread Amit Langote
Thanks for the review. On Mon, Dec 2, 2019 at 3:28 PM Michael Paquier wrote: > On Mon, Dec 02, 2019 at 02:30:47PM +0900, Amit Langote wrote: > > On Sun, Dec 1, 2019 at 4:33 AM Fabien COELHO wrote: > >> Patch applies, compiles, works for me. No further comments. > >> > >> I switched the patch as

Re: pgbench -i progress output on terminal

2019-12-02 Thread Fabien COELHO
Another question I have is why doing only that for the data initialization phase? Wouldn't it make sense to be consistent with the other tools having --progress and do the same dance in pgbench's printProgressReport()? I thought of it but did not suggest it. When running a bench I like

Re: pgbench -i progress output on terminal

2019-12-01 Thread Michael Paquier
On Mon, Dec 02, 2019 at 02:30:47PM +0900, Amit Langote wrote: > On Sun, Dec 1, 2019 at 4:33 AM Fabien COELHO wrote: >> Patch applies, compiles, works for me. No further comments. >> >> I switched the patch as ready. > > Thanks a lot. An issue with the patch as proposed is that its style is

Re: pgbench -i progress output on terminal

2019-12-01 Thread Amit Langote
Hi Fabien, On Sun, Dec 1, 2019 at 4:33 AM Fabien COELHO wrote: > Patch applies, compiles, works for me. No further comments. > > I switched the patch as ready. Thanks a lot. Regards, Amit

Re: pgbench -i progress output on terminal

2019-11-30 Thread Fabien COELHO
I wrote the v1 patch on CentOS Linux, and now on MacOS. It would be great if someone can volunteer to test on Windows terminal. I do not have that. Attached v3. Patch applies, compiles, works for me. No further comments. I switched the patch as ready. -- Fabien.

Re: pgbench -i progress output on terminal

2019-11-30 Thread Amit Langote
Hi Fabien, Thanks for taking a look again. On Sat, Nov 30, 2019 at 4:28 PM Fabien COELHO wrote: > > I have updated the patch based on these observations. Attached v2. > > Patch v2 applies & compiles cleanly, works for me. > > I'm not partial to Hungarian notation conventions, which is not

Re: pgbench -i progress output on terminal

2019-11-29 Thread Fabien COELHO
Hello Amit, I have updated the patch based on these observations. Attached v2. Patch v2 applies & compiles cleanly, works for me. I'm not partial to Hungarian notation conventions, which is not widely used elsewhere in pg. I'd suggest eolchar -> eol or line_end or whatever, but others

Re: pgbench -i progress output on terminal

2019-11-29 Thread Amit Langote
Hi Fabien, On Fri, Nov 29, 2019 at 10:13 PM Fabien COELHO wrote: > > I wonder why we don't use the same style for $subject as pg_basebackup > > --progress, that is, use a carriage return instead of a newline after > > each line reporting the number of tuples copied? > > Patch applies cleanly,

Re: pgbench -i progress output on terminal

2019-11-29 Thread Fabien COELHO
I wonder why we don't use the same style for $subject as pg_basebackup --progress, that is, use a carriage return instead of a newline after each line reporting the number of tuples copied? Patch applies cleanly, compiles, and works for me. My 0.02€: fprintf -> fputs or fputc to avoid a

Re: pgbench -i progress output on terminal

2019-11-27 Thread Amit Langote
Hi Fabien, On Thu, Nov 28, 2019 at 4:35 PM Fabien COELHO wrote: > > > Hello Amit, > > > I wonder why we don't use the same style for $subject as pg_basebackup > > --progress, that is, use a carriage return instead of a newline after > > each line reporting the number of tuples copied? > > Why

Re: pgbench -i progress output on terminal

2019-11-27 Thread Fabien COELHO
Hello Amit, I wonder why we don't use the same style for $subject as pg_basebackup --progress, that is, use a carriage return instead of a newline after each line reporting the number of tuples copied? Why not. Attached patch for that. I'll look into it. Could you add it to the CF app?

Re: pgbench -i progress output on terminal

2019-11-27 Thread Michael Paquier
On Thu, Nov 28, 2019 at 10:41:14AM +0900, Amit Langote wrote: > I wonder why we don't use the same style for $subject as pg_basebackup > --progress, that is, use a carriage return instead of a newline after > each line reporting the number of tuples copied? > > Attached patch for that. I have

pgbench -i progress output on terminal

2019-11-27 Thread Amit Langote
Hi, I wonder why we don't use the same style for $subject as pg_basebackup --progress, that is, use a carriage return instead of a newline after each line reporting the number of tuples copied? Attached patch for that. Thanks, Amit compactify-pgbench-init-progress-output.patch Description: