postgres_dba icon indicating copy to clipboard operation
postgres_dba copied to clipboard

Better connection monitoring

Open NikolayS opened this issue 7 years ago • 0 comments

example:

select
  state,
  count(*) "Total count",
  count(*) filter (where now() - state_change <= '1 second') as "Fresh (<1 sec)",
  count(*) filter (where now() - state_change > '1 second') as "Old (1+ sec)"
from pg_stat_activity
group by cube(state);

+ per host (clent_addr) + per app

NikolayS avatar Oct 11 '18 17:10 NikolayS