pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Magnus Hagander <magnus@hagander.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add pg_stat_database counters for sessions and session time
Date: Sun, 17 Jan 2021 13:07:03 +0000
Message-ID: <E1l17ln-0008K2-GB@gemulon.postgresql.org> (raw)

Add pg_stat_database counters for sessions and session time

This add counters for number of sessions, the different kind of session
termination types, and timers for how much time is spent in active vs
idle in a database to pg_stat_database.

Internally this also renames the parameter "force" to disconnect. This
was the only use-case for the parameter before, so repurposing it to
this mroe narrow usecase makes things cleaner than inventing something
new.

Author: Laurenz Albe
Reviewed-By: Magnus Hagander, Soumyadeep Chakraborty, Masahiro Ikeda
Discussion: https://postgr.es/m/b07e1f9953701b90c66ed368656f2aef40cac4fb.camel@cybertec.at

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/960869da0803427d14335bba24393f414b476e2c

Modified Files
--------------
doc/src/sgml/monitoring.sgml         |  77 ++++++++++++++++++++
src/backend/catalog/system_views.sql |   7 ++
src/backend/postmaster/pgstat.c      | 134 +++++++++++++++++++++++++++++++++--
src/backend/tcop/postgres.c          |  11 ++-
src/backend/utils/adt/pgstatfuncs.c  |  94 ++++++++++++++++++++++++
src/backend/utils/error/elog.c       |   8 +++
src/include/catalog/catversion.h     |   2 +-
src/include/catalog/pg_proc.dat      |  32 +++++++++
src/include/pgstat.h                 |  39 ++++++++++
src/test/regress/expected/rules.out  |   7 ++
10 files changed, 405 insertions(+), 6 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1l17ln-0008K2-GB@gemulon.postgresql.org>
Permalink:  ../E1l17ln-0008K2-GB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l17ln-0008K2-GB@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: magnus@hagander.net
  Subject: Re: pgsql: Add pg_stat_database counters for sessions and session time
  In-Reply-To: <E1l17ln-0008K2-GB@gemulon.postgresql.org>
  References: <E1l17ln-0008K2-GB@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