From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Track IO times in pg_stat_io
Date: Sat, 08 Apr 2023 00:09:31 +0000
Message-ID: <E1pkw94-001wgX-Jn@gemulon.postgresql.org> (raw)
Track IO times in pg_stat_io
a9c70b46dbe and 8aaa04b32S added counting of IO operations to a new view,
pg_stat_io. Now, add IO timing for reads, writes, extends, and fsyncs to
pg_stat_io as well.
This combines the tracking for pgBufferUsage with the tracking for pg_stat_io
into a new function pgstat_count_io_op_time(). This should make it a bit
easier to avoid the somewhat costly instr_time conversion done for
pgBufferUsage.
Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/flat/CAAKRu_ay5iKmnbXZ3DsauViF3eMxu4m1oNnJXqV_HyqYeg55Ww%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ac8d53dae5ae2914aeb022dc514826f71c7206e6
Modified Files
--------------
doc/src/sgml/monitoring.sgml | 59 ++++++++++++++++++
src/backend/catalog/system_views.sql | 4 ++
src/backend/storage/buffer/bufmgr.c | 66 ++++++--------------
src/backend/storage/buffer/localbuf.c | 31 ++++------
src/backend/storage/smgr/md.c | 31 ++++++----
src/backend/utils/activity/pgstat_io.c | 107 +++++++++++++++++++++++++++------
src/backend/utils/adt/pgstatfuncs.c | 64 ++++++++++++++++++--
src/include/catalog/pg_proc.dat | 6 +-
src/include/pgstat.h | 7 ++-
src/test/regress/expected/rules.out | 6 +-
src/tools/pgindent/typedefs.list | 1 +
11 files changed, 275 insertions(+), 107 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: andres@anarazel.de, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Track IO times in pg_stat_io
In-Reply-To: <E1pkw94-001wgX-Jn@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