On Wed, Nov 30, 2022 at 12:44 PM Drouvot, Bertrand <bertranddrouvot...@gmail.com> wrote: > > +CREATE VIEW pg_stat_checkpointer AS > + SELECT > + pg_stat_get_timed_checkpoints() AS checkpoints_timed, > + pg_stat_get_requested_checkpoints() AS checkpoints_req, > + pg_stat_get_checkpoint_write_time() AS checkpoint_write_time, > + pg_stat_get_checkpoint_sync_time() AS checkpoint_sync_time, > + pg_stat_get_buf_written_checkpoints() AS buffers_checkpoint, > + pg_stat_get_buf_written_backend() AS buffers_backend, > + pg_stat_get_buf_fsync_backend() AS buffers_backend_fsync, > + pg_stat_get_checkpointer_stat_reset_time() AS stats_reset; > + > > I still think that having checkpoints_ prefix in a pg_stat_checkpointer view > sounds "weird" (made sense when they were part of pg_stat_bgwriter) > > maybe we could have something like this instead? > > +CREATE VIEW pg_stat_checkpointer AS > + SELECT > + pg_stat_get_timed_checkpoints() AS num_timed, > + pg_stat_get_requested_checkpoints() AS num_req, > + pg_stat_get_checkpoint_write_time() AS total_write_time, > + pg_stat_get_checkpoint_sync_time() AS total_sync_time, > + pg_stat_get_buf_written_checkpoints() AS buffers_checkpoint, > + pg_stat_get_buf_written_backend() AS buffers_backend, > + pg_stat_get_buf_fsync_backend() AS buffers_backend_fsync, > + pg_stat_get_checkpointer_stat_reset_time() AS stats_reset; > +
I don't have a strong opinion about changing column names. However, if we were to change it, I prefer to use names that PgStat_CheckpointerStats has. BTW, that's what PgStat_BgWriterStats/pg_stat_bgwriter and PgStat_ArchiverStats/pg_stat_archiver uses. typedef struct PgStat_CheckpointerStats { PgStat_Counter timed_checkpoints; PgStat_Counter requested_checkpoints; PgStat_Counter checkpoint_write_time; /* times in milliseconds */ PgStat_Counter checkpoint_sync_time; PgStat_Counter buf_written_checkpoints; PgStat_Counter buf_written_backend; PgStat_Counter buf_fsync_backend; TimestampTz stat_reset_timestamp; } PgStat_CheckpointerStats; > That's a nit in any case and the patch LGTM. Thanks. -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com