pgsql: Show more processes in pg_stat_activity.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Show more processes in pg_stat_activity.
Date: 2017-03-27 02:07:16
Message-ID: E1csK3w-0000iO-Ae@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Show more processes in pg_stat_activity.

Previously, auxiliary processes and background workers not connected
to a database (such as the logical replication launcher) weren't
shown. Include them, so that we can see the associated wait state
information. Add a new column to identify the processes type, so that
people can filter them out easily using SQL if they wish.

Before this patch was written, there was discussion about whether we
should expose this information in a separate view, so as to avoid
contaminating pg_stat_activity with things people might not want to
see. But putting everything in pg_stat_activity was a more popular
choice, so that's what the patch does.

Kuntal Ghosh, reviewed by Amit Langote and Michael Paquier. Some
revisions and bug fixes by me.

Discussion: http://postgr.es/m/CA+TgmoYES5nhkEGw9nZXU8_FhA8XEm8NTm3-SO+3ML1B81Hkww@mail.gmail.com

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/fc70a4b0df38bda6a13941f1581f25fbb643c7f3

Modified Files
--------------
doc/src/sgml/monitoring.sgml | 15 ++-
src/backend/bootstrap/bootstrap.c | 4 +
src/backend/catalog/system_views.sql | 3 +-
src/backend/postmaster/pgstat.c | 194 ++++++++++++++++++++++++++++++-----
src/backend/postmaster/startup.c | 1 +
src/backend/replication/walsender.c | 4 +-
src/backend/storage/lmgr/proc.c | 27 +++++
src/backend/utils/adt/pgstatfuncs.c | 60 ++++++++---
src/backend/utils/init/postinit.c | 8 ++
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.h | 2 +-
src/include/pgstat.h | 26 +++++
src/include/storage/proc.h | 3 +-
src/test/regress/expected/rules.out | 9 +-
14 files changed, 305 insertions(+), 53 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2017-03-27 02:18:10 pgsql: Fix comment.
Previous Message Tom Lane 2017-03-26 23:15:07 pgsql: Improve performance of ExecEvalWholeRowVar.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-03-27 02:18:12 Re: comments in hash_alloc_buckets
Previous Message Craig Ringer 2017-03-27 02:01:42 Re: Logical decoding on standby