Introduce pg_stat_checkpointer
authorMichael Paquier <michael@paquier.xyz>
Mon, 30 Oct 2023 00:47:16 +0000 (09:47 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 30 Oct 2023 00:47:16 +0000 (09:47 +0900)
commit96f052613f35d07d001c8dd2f284ca8d95f82d1b
tree5a685b8ab234dda0862c915fd4526f39f09c9d39
parentbf01e1ba963aed17449c70fed03c4ae74cce3926
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
14 files changed:
doc/src/sgml/monitoring.sgml
src/backend/access/transam/xlog.c
src/backend/catalog/system_views.sql
src/backend/postmaster/checkpointer.c
src/backend/storage/buffer/bufmgr.c
src/backend/utils/activity/pgstat_checkpointer.c
src/backend/utils/adt/pgstatfuncs.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.dat
src/include/pgstat.h
src/test/recovery/t/029_stats_restart.pl
src/test/regress/expected/rules.out
src/test/regress/expected/stats.out
src/test/regress/sql/stats.sql