pgstat: split different types of stats into separate files.
authorAndres Freund <andres@anarazel.de>
Mon, 21 Mar 2022 19:02:25 +0000 (12:02 -0700)
committerAndres Freund <andres@anarazel.de>
Mon, 21 Mar 2022 19:02:25 +0000 (12:02 -0700)
commit13619598f1080d7923454634a2570ca1bc0f2fec
treedc04d18eb8055eafc481f29b71095a756c20341d
parentcb02fcb4c95bae08adaca1202c2081cfc81a28b5
pgstat: split different types of stats into separate files.

pgstat.c is very long, and it's hard to find an order that makes sense and is
likely to be maintained over time. Splitting the different pieces into
separate files makes that a lot easier.

With a few exceptions, this commit just moves code around. Those exceptions
are:
- adding file headers for new files
- removing 'static' from functions
- adapting pgstat_assert_is_up() to work across TUs
- minor comment adjustments
git diff --color-moved=dimmed-zebra is very helpful separating code movement
from code changes.

The next commit in this series will reorder pgstat.[ch] contents to be a bit
more coherent.

Earlier revisions of this patch had "global" statistics (archiver, bgwriter,
checkpointer, replication slots, SLRU, WAL) in one file, because each seemed
small enough. However later commits will increase their size and their
aggregate size is not insubstantial. It also just seems easier to split each
type of statistic into its own file.

Author: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20220303021600.hs34ghqcw6zcokdh@alap3.anarazel.de
13 files changed:
src/backend/postmaster/pgstat.c
src/backend/utils/activity/Makefile
src/backend/utils/activity/pgstat_archiver.c [new file with mode: 0644]
src/backend/utils/activity/pgstat_bgwriter.c [new file with mode: 0644]
src/backend/utils/activity/pgstat_checkpointer.c [new file with mode: 0644]
src/backend/utils/activity/pgstat_database.c [new file with mode: 0644]
src/backend/utils/activity/pgstat_function.c [new file with mode: 0644]
src/backend/utils/activity/pgstat_relation.c [new file with mode: 0644]
src/backend/utils/activity/pgstat_replslot.c [new file with mode: 0644]
src/backend/utils/activity/pgstat_slru.c [new file with mode: 0644]
src/backend/utils/activity/pgstat_subscription.c [new file with mode: 0644]
src/backend/utils/activity/pgstat_wal.c [new file with mode: 0644]
src/include/utils/pgstat_internal.h [new file with mode: 0644]