Skip to content

Commit

Permalink
Count WAL flushes in walreceiver (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
petuhovskiy authored and lubennikovaav committed Nov 21, 2022
1 parent d3ccbc1 commit 4a9cee9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/backend/replication/walreceiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,13 @@ WalReceiverMain(void)
if (endofwal)
break;

/*
* Update WAL statistics, which are produced inside
* issue_xlog_fsync function. This is useful for counting
* WAL flushes, by querying pg_stat_wal.
*/
pgstat_send_wal(true);

/*
* Ideally we would reuse a WaitEventSet object repeatedly
* here to avoid the overheads of WaitLatchOrSocket on epoll
Expand Down

0 comments on commit 4a9cee9

Please sign in to comment.