Re: Introduce a new view for checkpointer related stats - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Introduce a new view for checkpointer related stats
Date
Msg-id 20230209070349.7qtgx2npf264njrq@awork3.anarazel.de
Whole thread Raw
In response to Re: Introduce a new view for checkpointer related stats  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Introduce a new view for checkpointer related stats
List pgsql-hackers
Hi,

On 2023-02-09 12:21:51 +0530, Bharath Rupireddy wrote:
> @@ -1105,18 +1105,22 @@ CREATE VIEW pg_stat_archiver AS
>  
>  CREATE VIEW pg_stat_bgwriter AS
>      SELECT
> -        pg_stat_get_bgwriter_timed_checkpoints() AS checkpoints_timed,
> -        pg_stat_get_bgwriter_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_bgwriter_buf_written_checkpoints() AS buffers_checkpoint,
>          pg_stat_get_bgwriter_buf_written_clean() AS buffers_clean,
>          pg_stat_get_bgwriter_maxwritten_clean() AS maxwritten_clean,
> -        pg_stat_get_buf_written_backend() AS buffers_backend,
> -        pg_stat_get_buf_fsync_backend() AS buffers_backend_fsync,
>          pg_stat_get_buf_alloc() AS buffers_alloc,
>          pg_stat_get_bgwriter_stat_reset_time() AS stats_reset;
>  
> +CREATE VIEW pg_stat_checkpointer AS
> +    SELECT
> +        pg_stat_get_timed_checkpoints() AS timed_checkpoints,
> +        pg_stat_get_requested_checkpoints() AS requested_checkpoints,
> +        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_written_checkpoints,
> +        pg_stat_get_buf_written_backend() AS buffers_written_backend,
> +        pg_stat_get_buf_fsync_backend() AS buffers_fsync_backend,
> +        pg_stat_get_checkpointer_stat_reset_time() AS stats_reset;
> +

I don't think the backend written stats belong more accurately in
pg_stat_checkpointer than pg_stat_bgwriter.


I continue to be worried about breaking just about any postgres monitoring
setup.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Introduce a new view for checkpointer related stats
Next
From: Masahiko Sawada
Date:
Subject: Re: [PoC] Improve dead tuple storage for lazy vacuum