Refactor some code related to backend statistics
commit2c14037bb57c091b9f0bcbd36fa62138601beb55
authorMichael Paquier <michael@paquier.xyz>
Fri, 10 Jan 2025 00:00:48 +0000 (10 09:00 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 10 Jan 2025 00:00:48 +0000 (10 09:00 +0900)
tree78d8895f3bb93a7e5466d83ade223e8798bca791
parent39e3bcae44868734504c3decbb6708c36a5a84b2
Refactor some code related to backend statistics

This commit changes the way pending backend statistics are tracked by
moving them into a new structure called PgStat_BackendPending, removing
PgStat_BackendPendingIO.  PgStat_BackendPending currently only includes
PgStat_PendingIO for the pending I/O stats.

pgstat_flush_backend() is extended with a "flags" argument to control
which parts of the stats of a backend should be flushed.

With this refactoring, it becomes easier to plug into backend statistics
more data.  A patch to add information related to WAL in this stats kind
is under discussion.

Author: Bertrand Drouvot
Discussion: https://postgr.es/m/Z3zqc4o09dM/Ezyz@ip-10-97-1-34.eu-west-3.compute.internal
src/backend/utils/activity/pgstat.c
src/backend/utils/activity/pgstat_backend.c
src/backend/utils/activity/pgstat_io.c
src/backend/utils/activity/pgstat_relation.c
src/backend/utils/adt/pgstatfuncs.c
src/include/pgstat.h
src/include/utils/pgstat_internal.h
src/tools/pgindent/typedefs.list