Chetan Dev Khanna
Chetan Dev Khanna

Reputation: 127

How can I use pg_proctab extension in AWS Aurora for Monitoring purpose?

I have recently came across this pg_proctab extension through which we should be able to get the details of OS stats. However I am unable to get the value out of the functions built by this extension, Here is the the readme from the GIT code -

Currently only testing Linux, but support for other platforms will be added.

psql -f pg_proctab.sql
psql -f pg_loadavg.sql
psql -f pg_cputime.sql
psql -f pg_memusage.sql

Examples
--------
SELECT procpid
FROM pg_stat_activity;

SELECT *
FROM pg_proctab();

SELECT *
FROM pg_stat_activity, pg_proctab()
WHERE procpid = pid;

I believe procpid has been discontinued in later versions of postgresql so using WHERE pg_stat_activity.pid= pg_proctab.pid; instead.

when I run

SELECT *
FROM pg_stat_activity, pg_proctab()
WHERE pg_stat_activity.pid= pg_proctab.pid;

What are these columns and how is it related to the postgreSQL processes when I join it with pg_stat_activity?

Columns from pg_proctab()-

pid , comm , fullcomm , state , ppid , pgrp , session , tty_nr , tpgid , flags , minflt , cminflt , majflt , cmajflt , utime , stime , cutime , cstime , priority , nice , num_threads , itrealvalue , starttime , vsize , rss , exit_signal , processor , rt_priority , policy , delayacct_blkio_ticks , uid , username , rchar , wchar , syscr , syscw , reads , writes , cwrites 

Upvotes: 1

Views: 851

Answers (0)

Related Questions