@@ -134,7 +134,6 @@ int CommitSiblings = 5; /* # concurrent xacts needed to sleep */
134
134
int wal_retrieve_retry_interval = 5000 ;
135
135
int max_slot_wal_keep_size_mb = -1 ;
136
136
int wal_decode_buffer_size = 512 * 1024 ;
137
- bool track_wal_io_timing = false;
138
137
139
138
#ifdef WAL_DEBUG
140
139
bool XLOG_DEBUG = false;
@@ -2436,10 +2435,9 @@ XLogWrite(XLogwrtRqst WriteRqst, TimeLineID tli, bool flexible)
2436
2435
errno = 0 ;
2437
2436
2438
2437
/*
2439
- * Measure I/O timing to write WAL data, for pg_stat_io and/or
2440
- * pg_stat_wal.
2438
+ * Measure I/O timing to write WAL data, for pg_stat_io.
2441
2439
*/
2442
- start = pgstat_prepare_io_time (track_io_timing || track_wal_io_timing );
2440
+ start = pgstat_prepare_io_time ();
2443
2441
2444
2442
pgstat_report_wait_start (WAIT_EVENT_WAL_WRITE );
2445
2443
written = pg_pwrite (openLogFile , from , nleft , startoffset );
@@ -2448,20 +2446,6 @@ XLogWrite(XLogwrtRqst WriteRqst, TimeLineID tli, bool flexible)
2448
2446
pgstat_count_io_op_time (IOOBJECT_WAL , IOCONTEXT_NORMAL ,
2449
2447
IOOP_WRITE , start , 1 , written );
2450
2448
2451
- /*
2452
- * Increment the I/O timing and the number of times WAL data
2453
- * were written out to disk.
2454
- */
2455
- if (track_wal_io_timing )
2456
- {
2457
- instr_time end ;
2458
-
2459
- INSTR_TIME_SET_CURRENT (end );
2460
- INSTR_TIME_ACCUM_DIFF (PendingWalStats .wal_write_time , end , start );
2461
- }
2462
-
2463
- PendingWalStats .wal_write ++ ;
2464
-
2465
2449
if (written <= 0 )
2466
2450
{
2467
2451
char xlogfname [MAXFNAMELEN ];
@@ -3264,7 +3248,7 @@ XLogFileInitInternal(XLogSegNo logsegno, TimeLineID logtli,
3264
3248
errmsg ("could not create file \"%s\": %m" , tmppath )));
3265
3249
3266
3250
/* Measure I/O timing when initializing segment */
3267
- io_start = pgstat_prepare_io_time (track_io_timing );
3251
+ io_start = pgstat_prepare_io_time ();
3268
3252
3269
3253
pgstat_report_wait_start (WAIT_EVENT_WAL_INIT_WRITE );
3270
3254
save_errno = 0 ;
@@ -3326,7 +3310,7 @@ XLogFileInitInternal(XLogSegNo logsegno, TimeLineID logtli,
3326
3310
}
3327
3311
3328
3312
/* Measure I/O timing when flushing segment */
3329
- io_start = pgstat_prepare_io_time (track_io_timing );
3313
+ io_start = pgstat_prepare_io_time ();
3330
3314
3331
3315
pgstat_report_wait_start (WAIT_EVENT_WAL_INIT_SYNC );
3332
3316
if (pg_fsync (fd ) != 0 )
@@ -8758,10 +8742,9 @@ issue_xlog_fsync(int fd, XLogSegNo segno, TimeLineID tli)
8758
8742
return ;
8759
8743
8760
8744
/*
8761
- * Measure I/O timing to sync the WAL file for pg_stat_io and/or
8762
- * pg_stat_wal.
8745
+ * Measure I/O timing to sync the WAL file for pg_stat_io.
8763
8746
*/
8764
- start = pgstat_prepare_io_time (track_io_timing || track_wal_io_timing );
8747
+ start = pgstat_prepare_io_time ();
8765
8748
8766
8749
pgstat_report_wait_start (WAIT_EVENT_WAL_SYNC );
8767
8750
switch (wal_sync_method )
@@ -8807,21 +8790,8 @@ issue_xlog_fsync(int fd, XLogSegNo segno, TimeLineID tli)
8807
8790
8808
8791
pgstat_report_wait_end ();
8809
8792
8810
- /*
8811
- * Increment the I/O timing and the number of times WAL files were synced.
8812
- */
8813
- if (track_wal_io_timing )
8814
- {
8815
- instr_time end ;
8816
-
8817
- INSTR_TIME_SET_CURRENT (end );
8818
- INSTR_TIME_ACCUM_DIFF (PendingWalStats .wal_sync_time , end , start );
8819
- }
8820
-
8821
8793
pgstat_count_io_op_time (IOOBJECT_WAL , IOCONTEXT_NORMAL , IOOP_FSYNC ,
8822
8794
start , 1 , 0 );
8823
-
8824
- PendingWalStats .wal_sync ++ ;
8825
8795
}
8826
8796
8827
8797
/*
0 commit comments