Skip site navigation (1) Skip section navigation (2)

pgtop, display PostgreSQL processes in `top' style

From: Cosimo Streppone <cosimo(at)streppone(dot)it>
To: pgsql-announce(at)postgresql(dot)org
Cc: "DBD:"(at)svr1(dot)postgresql(dot)org:Pg list <dbdpg-general(at)gborg(dot)postgresql(dot)org>,pgsql-sql(at)postgresql(dot)org
Subject: pgtop, display PostgreSQL processes in `top' style
Date: 2005-04-30 22:10:30
Message-ID: 42740256.4090200@streppone.it (view raw or flat)
Thread:
Lists: pgsql-announcepgsql-sql
Hi everybody,

I'm currently working on something like a `mytop' clone,
also written in Perl with DBI + DBD::Pg interface.

mytop is a command line utility that displays mysql
server status and clients connected modeled after
`top' unix utility. (http://mytop.sourceforge.net).

What I'd like to achieve is something like that, but
for PostgreSQL, of course.
Now the project is in the very early stages, but it
already does something useful with Pg backend versions 7.2+
with stats enabled. Obviously, it looks at pg_stat*
relations to extract some useful information.

There are some things that are nice in `mytop', and I
think it would be nice to have also in `pgtop', but I
don't know how to replicate them:

1) is it possible to know Pg backend uptime with
    SQL queries? Or must I look at postmaster.pid file?
    or even something else?

2) how can I know the ip addresses/hostnames of clients
    connecting to server?

3) Is there a way to know the number of queries performed
    against Pg backend (by each client)? Can I distinguish
    between selects / updates / inserts / copy / ... ?

If you want to take a look at it, point your
browser at http://search.cpan.org/dist/pgtop .

-- 
Cosimo


Responses

pgsql-announce by date

Next:From: Tom LaneDate: 2005-05-02 03:04:49
Subject: Re: pgtop, display PostgreSQL processes in `top' style
Previous:From: Enrico WeigeltDate: 2005-04-27 17:07:43
Subject: Re: OpenRPT

pgsql-sql by date

Next:From: Ragnar HafstaĆ°Date: 2005-05-01 09:15:14
Subject: Re: can someone jelp me on this?
Previous:From: Metin OzisikDate: 2005-04-30 19:25:39
Subject: Re: Build issues: "-static" builds resulting initdb problems

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group