aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson <dgustafsson@postgresql.org>2023-09-15 19:05:57 +0200
committerDaniel Gustafsson <dgustafsson@postgresql.org>2023-09-15 19:05:57 +0200
commita396e20ad0da42b9cf64c39a99034523d819f008 (patch)
tree7ec4c41a3c9d401977c368ee7526c6eab0871950
parent18724af9e83bb9123e0e1cd09751aef4ba30039e (diff)
downloadpostgresql-a396e20ad0da42b9cf64c39a99034523d819f008.tar.gz
postgresql-a396e20ad0da42b9cf64c39a99034523d819f008.zip
Rename variable for code clarity
When tracking IO timing for WAL, the duration is what we calculate based on the start and end timestamps, it's not what the variable contains. Rename the timestamp variable to end to better communicate what it contains. Original patch by Krishnakumar with additional hacking to fix another occurrence by me. Author: Krishnakumar R <kksrcv001@gmail.com> Discussion: https://postgr.es/m/CAPMWgZ9f9o8awrQpjo8oxnNQ=bMDVPx00NE0QcDzvHD_ZrdLPw@mail.gmail.com
-rw-r--r--src/backend/access/transam/xlog.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 725a308debb..fcbde10529b 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -2226,10 +2226,10 @@ XLogWrite(XLogwrtRqst WriteRqst, TimeLineID tli, bool flexible)
*/
if (track_wal_io_timing)
{
- instr_time duration;
+ instr_time end;
- INSTR_TIME_SET_CURRENT(duration);
- INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_write_time, duration, start);
+ INSTR_TIME_SET_CURRENT(end);
+ INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_write_time, end, start);
}
PendingWalStats.wal_write++;
@@ -8252,10 +8252,10 @@ issue_xlog_fsync(int fd, XLogSegNo segno, TimeLineID tli)
*/
if (track_wal_io_timing)
{
- instr_time duration;
+ instr_time end;
- INSTR_TIME_SET_CURRENT(duration);
- 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);
}
PendingWalStats.wal_sync++;