log_checkpoints, microseconds

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: log_checkpoints, microseconds
Date: 2014-04-10 05:47:49
Message-ID: CAM3SWZSeqmy7YP71uZuYHiiRWXz_UTNF3GxSPAzE9mUH3c5d0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following code appears within md.c:

if (seg != NULL &&
FileSync(seg->mdfd_vfd) >= 0)
{
/* Success; update statistics about sync timing */
INSTR_TIME_SET_CURRENT(sync_end);
sync_diff = sync_end;
INSTR_TIME_SUBTRACT(sync_diff, sync_start);
elapsed = INSTR_TIME_GET_MICROSEC(sync_diff);
if (elapsed > longest)
longest = elapsed;
total_elapsed += elapsed;
processed++;
if (log_checkpoints)
elog(DEBUG1, "checkpoint sync: number=%d file=%s time=%.3f msec",
processed,
FilePathName(seg->mdfd_vfd),
(double) elapsed / 1000);

break; /* out of retry loop */
}

Did the author of this code really intend that "elapsed" microseconds
be divided by 1000 like this?
--
Peter Geoghegan

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message John R Pierce 2014-04-10 06:03:05 Re: log_checkpoints, microseconds
Previous Message Tom Lane 2014-04-10 03:13:57 Re: BUG #8695: Reloading dump fails at COMMENT ON EXTENSION plpgsql