aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pgstatfuncs.c
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2024-09-30 11:56:05 +0900
committerFujii Masao <fujii@postgresql.org>2024-09-30 11:56:05 +0900
commit559efce1d684069acf234a5cb032acba84e70938 (patch)
tree81fe6e80393961f50c21a0ffb472acdfcfc5a096 /src/backend/utils/adt/pgstatfuncs.c
parent20cfec896c6a20ca436f634b0ffa3582d7b9425c (diff)
downloadpostgresql-559efce1d684069acf234a5cb032acba84e70938.tar.gz
postgresql-559efce1d684069acf234a5cb032acba84e70938.zip
Add num_done counter to the pg_stat_checkpointer view.
Checkpoints can be skipped when the server is idle. The existing num_timed and num_requested counters in pg_stat_checkpointer track both completed and skipped checkpoints, but there was no way to count only the completed ones. This commit introduces the num_done counter, which tracks only completed checkpoints, making it easier to see how many were actually performed. Bump catalog version. Author: Anton A. Melnikov Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/9ea77f40-818d-4841-9dee-158ac8f6e690@oss.nttdata.com
Diffstat (limited to 'src/backend/utils/adt/pgstatfuncs.c')
-rw-r--r--src/backend/utils/adt/pgstatfuncs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c
index 9c23ac7c8c8..17b0fc02ef0 100644
--- a/src/backend/utils/adt/pgstatfuncs.c
+++ b/src/backend/utils/adt/pgstatfuncs.c
@@ -1192,6 +1192,12 @@ pg_stat_get_checkpointer_num_requested(PG_FUNCTION_ARGS)
}
Datum
+pg_stat_get_checkpointer_num_performed(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_INT64(pgstat_fetch_stat_checkpointer()->num_performed);
+}
+
+Datum
pg_stat_get_checkpointer_restartpoints_timed(PG_FUNCTION_ARGS)
{
PG_RETURN_INT64(pgstat_fetch_stat_checkpointer()->restartpoints_timed);