pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor some code related to backend statistics
Date: Fri, 10 Jan 2025 00:01:36 +0000
Message-ID: <E1tW2T2-000jw5-4s@gemulon.postgresql.org> (raw)

Refactor some code related to backend statistics

This commit changes the way pending backend statistics are tracked by
moving them into a new structure called PgStat_BackendPending, removing
PgStat_BackendPendingIO.  PgStat_BackendPending currently only includes
PgStat_PendingIO for the pending I/O stats.

pgstat_flush_backend() is extended with a "flags" argument to control
which parts of the stats of a backend should be flushed.

With this refactoring, it becomes easier to plug into backend statistics
more data.  A patch to add information related to WAL in this stats kind
is under discussion.

Author: Bertrand Drouvot
Discussion: https://postgr.es/m/Z3zqc4o09dM/Ezyz@ip-10-97-1-34.eu-west-3.compute.internal

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2c14037bb57c091b9f0bcbd36fa62138601beb55

Modified Files
--------------
src/backend/utils/activity/pgstat.c          |  2 +-
src/backend/utils/activity/pgstat_backend.c  | 69 ++++++++++++++++++++--------
src/backend/utils/activity/pgstat_io.c       |  8 ++--
src/backend/utils/activity/pgstat_relation.c |  4 +-
src/backend/utils/adt/pgstatfuncs.c          |  2 +-
src/include/pgstat.h                         | 17 +++++--
src/include/utils/pgstat_internal.h          |  7 ++-
src/tools/pgindent/typedefs.list             |  2 +-
8 files changed, 76 insertions(+), 35 deletions(-)



Message-ID: <E1tW2T2-000jw5-4s@gemulon.postgresql.org>
Permalink:  ../E1tW2T2-000jw5-4s@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tW2T2-000jw5-4s@gemulon.postgresql.org

 · 

reply

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: Refactor some code related to backend statistics
  In-Reply-To: <E1tW2T2-000jw5-4s@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