Add PgStat_KindInfo.init_shmem_cb
Michael Paquier <michael@paquier.xyz>
Add PgStat_KindInfo.init_shmem_cb This new callback gives fixed-numbered stats the possibility to take actions based on the area of shared memory allocated for them. This removes from pgstat_shmem.c any knowledge specific to the types of fixed-numbered stats, and the initializations happen in their own files. Like b68b29bc8fec, this change is useful to make this area of the code more pluggable, so as custom fixed-numbered stats can take actions after their shared memory area is initialized. Reviewed-by: Bertrand Drouvot Discussion: https://postgr.es/m/Zot5bxoPYdS7yaoy@paquier.xyz
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/activity/pgstat_archiver.c | modified | +8 −0 |
| src/backend/utils/activity/pgstat_bgwriter.c | modified | +8 −0 |
| src/backend/utils/activity/pgstat.c | modified | +6 −0 |
| src/backend/utils/activity/pgstat_checkpointer.c | modified | +8 −0 |
| src/backend/utils/activity/pgstat_io.c | modified | +9 −0 |
| src/backend/utils/activity/pgstat_shmem.c | modified | +11 −10 |
| src/backend/utils/activity/pgstat_slru.c | modified | +8 −0 |
| src/backend/utils/activity/pgstat_wal.c | modified | +8 −0 |
| src/include/utils/pgstat_internal.h | modified | +13 −0 |
Discussion
- Pluggable cumulative statistics 43 messages · 2024-06-13 → 2024-08-05