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: Invent pgstat_fetch_stat_backend_by_pid()
Date: Fri, 28 Feb 2025 02:21:54 +0000
Message-ID: <E1tnq0g-0004NU-1q@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c2a50ac678eb5ccee271aef3e7ed146ac395a32b

Modified Files
--------------
src/backend/utils/activity/pgstat_backend.c | 53 +++++++++++++++++++++++++++++
src/backend/utils/adt/pgstatfuncs.c         | 30 +---------------
src/include/pgstat.h                        |  2 ++
3 files changed, 56 insertions(+), 29 deletions(-)



Message-ID: <E1tnq0g-0004NU-1q@gemulon.postgresql.org>
Permalink:  ../E1tnq0g-0004NU-1q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tnq0g-0004NU-1q@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: Invent pgstat_fetch_stat_backend_by_pid()
  In-Reply-To: <E1tnq0g-0004NU-1q@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