postgresql/src/backend
Andres Freund 8fb580a35c pgstat: prepare APIs used by pgstatfuncs for shared memory stats.
With the introduction of PgStat_Kind PgStat_Single_Reset_Type,
PgStat_Shared_Reset_Target don't make sense anymore. Replace them with
PgStat_Kind.

Instead of having dedicated reset functions for different kinds of stats, use
two generic helper routines (one to reset all stats of a kind, one to reset
one stats entry).

A number of reset functions were named pgstat_reset_*_counter(), despite
affecting multiple counters. The generic helper routines get rid of
pgstat_reset_single_counter(), pgstat_reset_subscription_counter().

Rename pgstat_reset_slru_counter(), pgstat_reset_replslot_counter() to
pgstat_reset_slru(), pgstat_reset_replslot() respectively, and have them only
deal with a single SLRU/slot. Resetting all SLRUs/slots goes through the
generic pgstat_reset_of_kind().

Previously pg_stat_reset_replication_slot() used SearchNamedReplicationSlot()
to check if a slot exists. API wise it seems better to move that to
pgstat_replslot.c.

This is done separately from the - quite large - shared memory statistics
patch to make review easier.

Reviewed-By: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/20220404041516.cctrvpadhuriawlq@alap3.anarazel.de
2022-04-06 17:56:19 -07:00
..
access Suppress "variable 'pagesaving' set but not used" warning. 2022-04-06 17:03:50 -04:00
bootstrap pg_upgrade: Preserve relfilenodes and tablespace OIDs. 2022-01-17 13:40:27 -05:00
catalog pgstat: add pgstat_copy_relation_stats(). 2022-04-06 14:09:18 -07:00
commands pgstat: stats collector references in comments. 2022-04-06 13:56:06 -07:00
executor Refactor and cleanup runtime partition prune code a little 2022-04-05 11:46:48 +02:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit SQL/JSON query functions 2022-03-29 16:57:13 -04:00
lib dshash: revise sequential scan support. 2022-04-04 14:32:52 -07:00
libpq Add system view pg_ident_file_mappings 2022-03-29 10:15:48 +09:00
main Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
nodes Allow asynchronous execution in more cases. 2022-04-06 15:45:00 +09:00
optimizer Allow asynchronous execution in more cases. 2022-04-06 15:45:00 +09:00
parser Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
partitioning Refactor and cleanup runtime partition prune code a little 2022-04-05 11:46:48 +02:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Ensure that the argument of shmdt(2) is declared "void *". 2022-02-15 17:17:28 -05:00
postmaster pgstat: prepare APIs used by pgstatfuncs for shared memory stats. 2022-04-06 17:56:19 -07:00
regex Call pg_newlocale_from_collation() also with default collation 2022-01-20 09:50:18 +01:00
replication pgstat: stats collector references in comments. 2022-04-06 13:56:06 -07:00
rewrite Add support for MERGE SQL command 2022-03-28 16:47:48 +02:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
storage dsm: allow use in single user mode. 2022-04-06 12:40:04 -07:00
tcop pgstat: stats collector references in comments. 2022-04-06 13:56:06 -07:00
tsearch Update copyright for 2022 2022-01-07 19:04:57 -05:00
utils pgstat: prepare APIs used by pgstatfuncs for shared memory stats. 2022-04-06 17:56:19 -07:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Server-side gzip compression. 2022-01-24 15:13:18 -05:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00