diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-10-30 09:47:16 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-10-30 09:47:16 +0900 |
commit | 96f052613f35d07d001c8dd2f284ca8d95f82d1b (patch) | |
tree | 5a685b8ab234dda0862c915fd4526f39f09c9d39 /src/backend/postmaster/checkpointer.c | |
parent | bf01e1ba963aed17449c70fed03c4ae74cce3926 (diff) | |
download | postgresql-96f052613f35d07d001c8dd2f284ca8d95f82d1b.tar.gz postgresql-96f052613f35d07d001c8dd2f284ca8d95f82d1b.zip |
Introduce pg_stat_checkpointer
Historically, the statistics of the checkpointer have been always part
of pg_stat_bgwriter. This commit removes a few columns from
pg_stat_bgwriter, and introduces pg_stat_checkpointer with equivalent,
renamed columns (plus a new one for the reset timestamp):
- checkpoints_timed -> num_timed
- checkpoints_req -> num_requested
- checkpoint_write_time -> write_time
- checkpoint_sync_time -> sync_time
- buffers_checkpoint -> buffers_written
The fields of PgStat_CheckpointerStats and its SQL functions are renamed
to match with the new field names, for consistency. Note that
background writer and checkpointer have been split into two different
processes in commits 806a2aee3791 and bf405ba8e460. The pgstat
structures were already split, making this change straight-forward.
Bump catalog version.
Author: Bharath Rupireddy
Reviewed-by: Bertrand Drouvot, Andres Freund, Michael Paquier
Discussion: https://postgr.es/m/CALj2ACVxX2ii=66RypXRweZe2EsBRiPMj0aHfRfHUeXJcC7kHg@mail.gmail.com
Diffstat (limited to 'src/backend/postmaster/checkpointer.c')
-rw-r--r-- | src/backend/postmaster/checkpointer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index 4fe403c9a89..a3c1aba24ea 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -358,7 +358,7 @@ CheckpointerMain(void) if (((volatile CheckpointerShmemStruct *) CheckpointerShmem)->ckpt_flags) { do_checkpoint = true; - PendingCheckpointerStats.requested_checkpoints++; + PendingCheckpointerStats.num_requested++; } /* @@ -372,7 +372,7 @@ CheckpointerMain(void) if (elapsed_secs >= CheckPointTimeout) { if (!do_checkpoint) - PendingCheckpointerStats.timed_checkpoints++; + PendingCheckpointerStats.num_timed++; do_checkpoint = true; flags |= CHECKPOINT_CAUSE_TIME; } @@ -569,7 +569,7 @@ HandleCheckpointerInterrupts(void) * updates the statistics, increment the checkpoint request and flush * out pending statistic. */ - PendingCheckpointerStats.requested_checkpoints++; + PendingCheckpointerStats.num_requested++; ShutdownXLOG(0, 0); pgstat_report_checkpointer(); pgstat_report_wal(true); |