pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Add pg_stat_database counters for sessions and session time
3+ messages / 2 participants
[nested] [flat]

* pgsql: Add pg_stat_database counters for sessions and session time
@ 2021-01-17 13:07 Magnus Hagander <magnus@hagander.net>
  2021-01-18 16:09 ` Re: pgsql: Add pg_stat_database counters for sessions and session time Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 3+ messages in thread

From: Magnus Hagander @ 2021-01-17 13:07 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Add pg_stat_database counters for sessions and session time
  2021-01-17 13:07 pgsql: Add pg_stat_database counters for sessions and session time Magnus Hagander <magnus@hagander.net>
@ 2021-01-18 16:09 ` Laurenz Albe <laurenz.albe@cybertec.at>
  2021-01-18 16:53   ` Re: pgsql: Add pg_stat_database counters for sessions and session time Magnus Hagander <magnus@hagander.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Laurenz Albe @ 2021-01-18 16:09 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; pgsql-committers@lists.postgresql.org

On Sun, 2021-01-17 at 13:07 +0000, Magnus Hagander wrote:
> 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.

Should't this update PGSTAT_FILE_FORMAT_ID in include/pgstat.h
since "struct PgStat_StatDBEntry" was changed?

Yours,
Laurenz Albe






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Add pg_stat_database counters for sessions and session time
  2021-01-17 13:07 pgsql: Add pg_stat_database counters for sessions and session time Magnus Hagander <magnus@hagander.net>
  2021-01-18 16:09 ` Re: pgsql: Add pg_stat_database counters for sessions and session time Laurenz Albe <laurenz.albe@cybertec.at>
@ 2021-01-18 16:53   ` Magnus Hagander <magnus@hagander.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Magnus Hagander @ 2021-01-18 16:53 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>

On Mon, Jan 18, 2021 at 5:09 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>
> On Sun, 2021-01-17 at 13:07 +0000, Magnus Hagander wrote:
> > 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.
>
> Should't this update PGSTAT_FILE_FORMAT_ID in include/pgstat.h
> since "struct PgStat_StatDBEntry" was changed?

Per my reply in the other thread -- yes it should. Fixed.

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-01-18 16:53 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-17 13:07 pgsql: Add pg_stat_database counters for sessions and session time Magnus Hagander <magnus@hagander.net>
2021-01-18 16:09 ` Laurenz Albe <laurenz.albe@cybertec.at>
2021-01-18 16:53   ` Magnus Hagander <magnus@hagander.net>

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