From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use pgstat_kind_infos to write fixed shared statistics
Date: Tue, 09 Jul 2024 01:28:08 +0000
Message-ID: <E1sQzeK-000vP2-23@gemulon.postgresql.org> (raw)
Use pgstat_kind_infos to write fixed shared statistics
This is similar to 9004abf6206e, but this time for the write part of the
stats file. The code is changed so as, rather than referring to
individual members of PgStat_Snapshot in an order based on their
PgStat_Kind value, a loop based on pgstat_kind_infos is used to retrieve
the contents to write from the snapshot structure, for a size of
PgStat_KindInfo's shared_data_len.
This requires the addition to PgStat_KindInfo of an offset to track the
location of each fixed-numbered stats in PgStat_Snapshot. This change
is useful to make this area of the code more easily pluggable, and
reduces the knowledge of specific fixed-numbered kinds in pgstat.c.
Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/Zot5bxoPYdS7yaoy@paquier.xyz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b68b29bc8feca0eb340cb857ff1d28d4099c7878
Modified Files
--------------
src/backend/utils/activity/pgstat.c | 56 ++++++++++++-------------------------
src/include/utils/pgstat_internal.h | 6 ++++
2 files changed, 24 insertions(+), 38 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Use pgstat_kind_infos to write fixed shared statistics
In-Reply-To: <E1sQzeK-000vP2-23@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox