Add write_to_file to PgStat_KindInfo for pgstats kinds
Michael Paquier <michael@paquier.xyz>
Add write_to_file to PgStat_KindInfo for pgstats kinds This new field controls if entries of a stats kind should be written or not to the on-disk pgstats file when shutting down an instance. This affects both fixed and variable-numbered kinds. This is useful for custom statistics by itself, and a patch is under discussion to add a new builtin stats kind where the write of the stats is not necessary. All the built-in stats kinds, as well as the two custom stats kinds in the test module injection_points, set this flag to "true" for now, so as stats entries are written to the on-disk pgstats file. Author: Bertrand Drouvot Reviewed-by: Nazir Bilal Yavuz Discussion: https://postgr.es/m/Zz7T47nHwYgeYwOe@ip-10-97-1-34.eu-west-3.compute.internal
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/activity/pgstat.c | modified | +21 −1 |
| src/include/utils/pgstat_internal.h | modified | +3 −0 |
| src/test/modules/injection_points/injection_stats.c | modified | +1 −0 |
| src/test/modules/injection_points/injection_stats_fixed.c | modified | +1 −0 |
Discussion
- Add a write_to_file member to PgStat_KindInfo 12 messages · 2024-11-20 → 2024-11-22