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: Merge pgstat_count_io_op_n() and pgstat_count_io_op()
Date: Fri, 10 Jan 2025 00:59:12 +0000
Message-ID: <E1tW3Mm-000kXw-Nh@gemulon.postgresql.org> (raw)

Merge pgstat_count_io_op_n() and pgstat_count_io_op()

The pgstat_count_io_op() function, which counts a single I/O operation,
wraps pgstat_count_io_op_n() with a counter value of 1.  The latter is
declared in pgstat.h and used nowhere in the code, so let's remove it in
favor of the former.

This change makes also the code more symmetric with
pgstat_count_io_op_time(), that already uses a similar set of arguments,
except that it counts also the I/O time.  This will ease a bit the
integration of a follow-up patch that adds byte-level tracking in
pg_stat_io for some of its attributes, lifting the current restriction
based on BLCKSZ as all I/O operations are assumed to be block-based.

Author: Nazir Bilal Yavuz
Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/CAN55FZ32ze812=yjyZg1QeXhKvACUM_Nu0_gyPQcUKKuVHL5xA@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c    |  4 ++--
src/backend/storage/buffer/localbuf.c  |  2 +-
src/backend/utils/activity/pgstat_io.c | 12 +++---------
src/include/pgstat.h                   |  4 ++--
4 files changed, 8 insertions(+), 14 deletions(-)



Message-ID: <E1tW3Mm-000kXw-Nh@gemulon.postgresql.org>
Permalink:  ../E1tW3Mm-000kXw-Nh@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tW3Mm-000kXw-Nh@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: Merge pgstat_count_io_op_n() and pgstat_count_io_op()
  In-Reply-To: <E1tW3Mm-000kXw-Nh@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