diff options
author | Michael Paquier <michael@paquier.xyz> | 2025-02-26 16:48:54 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2025-02-26 16:48:54 +0900 |
commit | 0e42d31b0b2273c376ce9de946b59d155fac589c (patch) | |
tree | 87c7e5a0016d657fbc70a6d19bcce43e7fe7bf97 /src/include/pgstat.h | |
parent | d7cbeaf261da346d8c745870da1d31075ae0313c (diff) | |
download | postgresql-0e42d31b0b2273c376ce9de946b59d155fac589c.tar.gz postgresql-0e42d31b0b2273c376ce9de946b59d155fac589c.zip |
Adding new PgStat_WalCounters structure in pgstat.h
This new structure contains the counters and the data related to the WAL
activity statistics gathered from WalUsage, separated into its own
structure so as it can be shared across more than one Stats structure in
pg_stat.h.
This refactoring will be used by an upcoming patch introducing
backend-level WAL statistics.
Bump PGSTAT_FILE_FORMAT_ID.
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.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h index e64c527265b..67656264b62 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -212,7 +212,7 @@ typedef struct PgStat_TableXactStatus * ------------------------------------------------------------ */ -#define PGSTAT_FILE_FORMAT_ID 0x01A5BCB4 +#define PGSTAT_FILE_FORMAT_ID 0x01A5BCB5 typedef struct PgStat_ArchiverStats { @@ -474,12 +474,29 @@ typedef struct PgStat_StatTabEntry PgStat_Counter total_autoanalyze_time; } PgStat_StatTabEntry; -typedef struct PgStat_WalStats +/* ------ + * PgStat_WalCounters WAL activity data gathered from WalUsage + * + * This stores all the counters and data gathered from WalUsage for WAL + * activity statistics, separated into its own structure so as this can be + * shared across multiple Stats structures. + * ------ + */ +typedef struct PgStat_WalCounters { PgStat_Counter wal_records; PgStat_Counter wal_fpi; uint64 wal_bytes; PgStat_Counter wal_buffers_full; +} PgStat_WalCounters; + +/* ------- + * PgStat_WalStats WAL statistics + * ------- + */ +typedef struct PgStat_WalStats +{ + PgStat_WalCounters wal_counters; TimestampTz stat_reset_timestamp; } PgStat_WalStats; |