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: Add system view pg_wait_events
Date: Sun, 20 Aug 2023 06:38:28 +0000
Message-ID: <E1qXc4y-0012t7-BI@gemulon.postgresql.org> (raw)

Add system view pg_wait_events

This new view, wrapped around a SRF, shows some information known about
wait events, as of:
- Name.
- Type (Activity, I/O, Extension, etc.).
- Description.

All the information retrieved comes from wait_event_names.txt, and the
description is the same as the documentation with filters applied to
remove any XML markups.  This view is useful when joined with
pg_stat_activity to get the description of a wait event reported.

Custom wait events for extensions are included in the view.

Original idea by Yves Colin.

Author: Bertrand Drouvot
Reviewed-by: Kyotaro Horiguchi, Masahiro Ikeda, Tom Lane, Michael
Paquier
Discussion: https://postgr.es/m/0e2ae164-dc89-03c3-cf7f-de86378053ac@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1e68e43d3f0ff1dcf4a5926f9d6336b86bda034d

Modified Files
--------------
doc/src/sgml/monitoring.sgml                       | 14 +++-
doc/src/sgml/system-views.sgml                     | 64 +++++++++++++++
src/backend/Makefile                               |  3 +-
src/backend/catalog/system_views.sql               |  3 +
src/backend/utils/activity/.gitignore              |  1 +
src/backend/utils/activity/Makefile                |  8 +-
.../utils/activity/generate-wait_event_types.pl    | 56 ++++++++++++-
src/backend/utils/activity/meson.build             |  1 +
src/backend/utils/activity/wait_event.c            | 40 ++++++++++
src/backend/utils/activity/wait_event_funcs.c      | 93 ++++++++++++++++++++++
src/include/catalog/pg_proc.dat                    |  6 ++
src/include/utils/meson.build                      |  4 +-
src/include/utils/wait_event.h                     |  1 +
src/test/modules/worker_spi/t/001_worker_spi.pl    |  6 ++
src/test/regress/expected/rules.out                |  4 +
src/test/regress/expected/sysviews.out             | 16 ++++
src/test/regress/sql/sysviews.sql                  |  4 +
src/tools/msvc/Solution.pm                         |  3 +-
src/tools/msvc/clean.bat                           |  1 +
19 files changed, 317 insertions(+), 11 deletions(-)



Message-ID: <E1qXc4y-0012t7-BI@gemulon.postgresql.org>
Permalink:  ../E1qXc4y-0012t7-BI@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qXc4y-0012t7-BI@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: Add system view pg_wait_events
  In-Reply-To: <E1qXc4y-0012t7-BI@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