Re: Small patch modifying variable name to reflect the logic involved - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Small patch modifying variable name to reflect the logic involved
Date
Msg-id C37DEA93-26D9-49C6-AAB6-39AEB6B046DD@yesql.se
Whole thread Raw
In response to Small patch modifying variable name to reflect the logic involved  (Krishnakumar R <kksrcv001@gmail.com>)
Responses Re: Small patch modifying variable name to reflect the logic involved
List pgsql-hackers
> On 14 Sep 2023, at 08:28, Krishnakumar R <kksrcv001@gmail.com> wrote:

> Please find a small patch to improve code readability by modifying
> variable name to reflect the logic involved - finding diff between end
> and start time of WAL sync.

-    INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_sync_time, duration, start);
+    INSTR_TIME_SET_CURRENT(end);
+    INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_sync_time, end, start);

Agreed, the duration is the result of the INSTR_TIME_ACCUM_DIFF calculation,
not what's stored in the instr_time variable.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Quoting filename in using facing log messages
Next
From: Daniel Gustafsson
Date:
Subject: Re: [PATCH] Add native windows on arm64 support