Refactor some code related to backend statistics
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/activity/pgstat_backend.c | modified | +49 −20 |
| src/backend/utils/activity/pgstat.c | modified | +1 −1 |
| src/backend/utils/activity/pgstat_io.c | modified | +4 −4 |
| src/backend/utils/activity/pgstat_relation.c | modified | +2 −2 |
| src/backend/utils/adt/pgstatfuncs.c | modified | +1 −1 |
| src/include/pgstat.h | modified | +13 −4 |
| src/include/utils/pgstat_internal.h | modified | +5 −2 |
| src/tools/pgindent/typedefs.list | modified | +1 −1 |
Discussion
- per backend WAL statistics 74 messages · 2025-01-07 → 2025-04-07