summaryrefslogtreecommitdiff
path: root/src/include/pgstat.h
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2025-02-28 11:20:31 +0900
committerMichael Paquier <michael@paquier.xyz>2025-02-28 11:20:31 +0900
commitc2a50ac678eb5ccee271aef3e7ed146ac395a32b (patch)
tree98145d57e043c33125f83fc1718c46b181e734dc /src/include/pgstat.h
parent2a083ab807db6d9e2e0e3aa82ee8f6ff9fc44c8d (diff)
Invent pgstat_fetch_stat_backend_by_pid()
This code is extracted from pg_stat_get_backend_io() in pgstatfuncs.c, so as it can be shared with other areas that need backend pgstats entries while having the benefits of the various sanity checks refactored here. As per its name, this retrieves backend statistics based on a PID, with the option of retrieving a BackendType if given in input. Currently, this is used for the backend-level IO statistics. The next move would be to reuse that for the backend-level WAL statistics. Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/Z3zqc4o09dM/Ezyz@ip-10-97-1-34.eu-west-3.compute.internal
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r--src/include/pgstat.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index 67656264b62..4aad10b0b6d 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -554,6 +554,8 @@ extern void pgstat_count_backend_io_op(IOObject io_object,
IOOp io_op, uint32 cnt,
uint64 bytes);
extern PgStat_Backend *pgstat_fetch_stat_backend(ProcNumber procNumber);
+extern PgStat_Backend *pgstat_fetch_stat_backend_by_pid(int pid,
+ BackendType *bktype);
extern bool pgstat_tracks_backend_bktype(BackendType bktype);
extern void pgstat_create_backend(ProcNumber procnum);