pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Magnus Hagander <magnus@hagander.net>
Cc: Ahsan Hadi <ahsan.hadi@gmail.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Soumyadeep Chakraborty <soumyadeep2007@gmail.com>
Cc: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Add session statistics to pg_stat_database
Date: Fri, 04 Dec 2020 16:55:52 +0100
Message-ID: <6fac65dcf175175f95d5fb2aeae731b70bec0a58.camel@cybertec.at> (raw)
In-Reply-To: <27530e647d14ef49199694ea3c376935fa7285e8.camel@cybertec.at>
References: <b07e1f9953701b90c66ed368656f2aef40cac4fb.camel@cybertec.at>
	<CA+9bhC+pGpp9xezwk-maOWmOCNg-0xm5OnPSSMmb2S=n7fTwMA@mail.gmail.com>
	<68050bc3d927050061d0b106905d69b3bb39fed2.camel@cybertec.at>
	<70a90a9b4a7e1df47ede3b01774608246bd929ee.camel@cybertec.at>
	<CAE-ML+_z17fYZ_R-EeusTNk_8ewYgn5WyeKnC5ctNFjvVw9xdw@mail.gmail.com>
	<95a4c49710cdf8be220bc8267872b171c2e3f182.camel@cybertec.at>
	<CAE-ML+_MGVnMdwbCjZP6ZxDbT1980J2Az-C6bshHhGwSrijRng@mail.gmail.com>
	<f6849f80b02d2fa857687c67be4a6d5875500dd4.camel@cybertec.at>
	<20201013225548.GQ9241@telsasoft.com>
	<f9553a0de5f13b89e8e0c3823a5ff17d56fa8a82.camel@cybertec.at>
	<CA+9bhCJjE-+QPyyUWah1Be2J=oDy7_J3o3WM902YF4HHD+ep=g@mail.gmail.com>
	<9e1c7bf4a654e50973b1be7770dda31431538351.camel@cybertec.at>
	<CABUevEyg197S7dDgq8dhttg+u-cz+4REUA13BLMd1NvjvOXSTg@mail.gmail.com>
	<2099659e5d679d070f0bb2edb573f296f3c9813f.camel@cybertec.at>
	<CABUevEzx9bFWkarv7rc+CCZemG-77y0wHOn8fg3e-OePVS=D-Q@mail.gmail.com>
	<27530e647d14ef49199694ea3c376935fa7285e8.camel@cybertec.at>

On Thu, 2020-12-03 at 13:22 +0100, Laurenz Albe wrote:
> > Basically, that would change pgStatSessionDisconnectedNormally into instead being an
> > enum of reasons, which could be normal disconnect, abnormal disconnect and admin.
> > And we'd track all those three as separate numbers in the stats file, meaning we could
> > then calculate the crash by subtracting all three from the total number of sessions?
> 
> I think at least "closed by admin" might be interesting; I'll have a look.
> I don't think we have to specifically count "closed by normal disconnect", because
> that should be the rule and could be more or less deduced from the other numbers
> (with the uncertainty mentioned above).
> 
> > (Let me know if you think the idea could work and would prefer it if I worked up a
> > complete suggestion based on it rather than just spitting ideas)
> 
> Thanks for the offer, and I'll get back to it if I get stuck.

Ok, I could use a pointer.

I am considering the cases

1) client just went away (currently "aborted")
2) death by FATAL error
3) killed by the administrator (or shutdown)

What is a good place in the code to tell 2) or 3)
so that I can set the state accordingly?

Yours,
Laurenz Albe






view thread (34+ messages)  latest in thread

Message-ID: <6fac65dcf175175f95d5fb2aeae731b70bec0a58.camel@cybertec.at>
Permalink:  ../6fac65dcf175175f95d5fb2aeae731b70bec0a58.camel@cybertec.at/
Also on:    postgresql.org/message-id/6fac65dcf175175f95d5fb2aeae731b70bec0a58.camel@cybertec.at

 · 

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-hackers@postgresql.org
  Cc: laurenz.albe@cybertec.at, magnus@hagander.net, ahsan.hadi@gmail.com, pryzby@telsasoft.com, soumyadeep2007@gmail.com, ikedamsh@oss.nttdata.com
  Subject: Re: Add session statistics to pg_stat_database
  In-Reply-To: <6fac65dcf175175f95d5fb2aeae731b70bec0a58.camel@cybertec.at>
  References: <b07e1f9953701b90c66ed368656f2aef40cac4fb.camel@cybertec.at> <70a90a9b4a7e1df47ede3b01774608246bd929ee.camel@cybertec.at> <CAE-ML+_z17fYZ_R-EeusTNk_8ewYgn5WyeKnC5ctNFjvVw9xdw@mail.gmail.com> <95a4c49710cdf8be220bc8267872b171c2e3f182.camel@cybertec.at> <CAE-ML+_MGVnMdwbCjZP6ZxDbT1980J2Az-C6bshHhGwSrijRng@mail.gmail.com> <f6849f80b02d2fa857687c67be4a6d5875500dd4.camel@cybertec.at> <20201013225548.GQ9241@telsasoft.com> <f9553a0de5f13b89e8e0c3823a5ff17d56fa8a82.camel@cybertec.at> <CA+9bhCJjE-+QPyyUWah1Be2J=oDy7_J3o3WM902YF4HHD+ep=g@mail.gmail.com> <9e1c7bf4a654e50973b1be7770dda31431538351.camel@cybertec.at> <CABUevEyg197S7dDgq8dhttg+u-cz+4REUA13BLMd1NvjvOXSTg@mail.gmail.com> <2099659e5d679d070f0bb2edb573f296f3c9813f.camel@cybertec.at> <CABUevEzx9bFWkarv7rc+CCZemG-77y0wHOn8fg3e-OePVS=D-Q@mail.gmail.com> <27530e647d14ef49199694ea3c376935fa7285e8.camel@cybertec.at> <6fac65dcf175175f95d5fb2aeae731b70bec0a58.camel@cybertec.at>

* 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