Re: Progress reporting for pg_verify_checksums

From: Michael Banck <michael(dot)banck(at)credativ(dot)de>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, alvherre(at)2ndquadrant(dot)com, mailings(at)oopsware(dot)de, thomas(dot)munro(at)enterprisedb(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Progress reporting for pg_verify_checksums
Date: 2019-03-28 08:48:12
Message-ID: 1553762892.4884.41.camel@credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Am Donnerstag, den 28.03.2019, 09:41 +0100 schrieb Fabien COELHO:
> Hallo Michael,
>
> > > Or anything which converts to double early.
> > Are you sure, seeing elapsed is a double already?
>
>
> Argh, I missed that. You are right that a double elapsed is enough for the
> second part. However, with
>
> + current_speed = (current_size / MEGABYTES) / (elapsed / 1000.0);
>
> the first division is an integer one because both operands are ints, so
> megabytes conversion is rounded down. I'd suggest:
>
> + current_speed = ((double) current_size / MEGABYTES) / (elapsed / 1000);

Ok.

> > > Ok, it is more complicated that it looks for large sizes if second is not
> > > the right display unit.
> >
> > Right, new version attached.
>
> Applies, compiles, global & local "make check" (although not tested) ok,
> doc build ok, manual tests ok.

Thanks.

> Otherwise a very minor comment: I'd invert !force and the computations in
> the return condition to avoid the computations when not needed.

The force is only ever true right at the end of the program so it would
not save anything really and detract from the main gist of that
statement, so I left it as-is.

Michael

--
Michael Banck
Projektleiter / Senior Berater
Tel.: +49 2166 9901-171
Fax: +49 2166 9901-100
Email: michael(dot)banck(at)credativ(dot)de

credativ GmbH, HRB Mönchengladbach 12080
USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer

Unser Umgang mit personenbezogenen Daten unterliegt
folgenden Bestimmungen: https://www.credativ.de/datenschutz

Attachment Content-Type Size
pg_verify_checksums_progress_V15.patch text/x-patch 8.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2019-03-28 08:48:41 Re: Planning counters in pg_stat_statements (using pgss_store)
Previous Message Fabien COELHO 2019-03-28 08:41:57 Re: Progress reporting for pg_verify_checksums