Re: per backend I/O statistics

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Nazir Bilal Yavuz <byavuz81@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2024-12-24T05:35:16Z
Lists: pgsql-hackers
On Fri, Dec 20, 2024 at 09:57:19AM +0000, Bertrand Drouvot wrote:
> BTW, now that the per backend I/O statistics is done, I'll start working on per
> backend wal statistics.

I think that this is a good idea.  It does not actually overlap the
proposal in [1] as the stats persistency is not the same.  What this
thread has taught me is that you could just plug in the stats of the
new backend-level structure a PgStat_WalStats and retrieve them with a
new function that returns a single tuple with the WAL stats
attributes.  That should be rather straight-forward to achieve.

[1]: https://commitfest.postgresql.org/51/4950/
--
Michael

Commits

  1. Rework handling of pending data for backend statistics

  2. Rename some pgstats callbacks related to flush of entries

  3. Relax regression test for fsync check of backend-level stats

  4. Add backend-level statistics to pgstats

  5. Extract logic filling pg_stat_get_io()'s tuplestore into its own routine

  6. Tweak some comments related to variable-numbered stats in pgstat.c