Re: Getting time-dependent load statistics - Mailing list pgsql-general

From Torsten Bronger
Subject Re: Getting time-dependent load statistics
Date
Msg-id 87d4dd0xaw.fsf@physik.rwth-aachen.de
Whole thread Raw
In response to Getting time-dependent load statistics  (Torsten Bronger <bronger@physik.rwth-aachen.de>)
List pgsql-general
Hallöchen!

Joshua D. Drake writes:

> On Fri, 2009-02-20 at 17:11 +0100, Torsten Bronger wrote:
>
>> Yesterday I ported a web app to PG.  Every 10 minutes, a cron job
>> scanned the log files of MySQL and generated a plot showing the
>> queries/sec for the last 24h.  (Admittedly queries/sec is not the
>> holy grail of DB statistics.)
>>
>> But I still like to have something like this.  [...]
>>
>
> Do you want queries, or transactions? If you want transactions you
> already have that in pg_stat_database. Just do this every 10
> minutes:
>
> psql -U <user> -d <database> -c "select now() as time,sum(xact_commit)
> as transactions from pg_stat_Database"

Well, I'm afraid that transactions are too different from each
other.  Currently, I experiment with

SELECT tup_returned + tup_fetched + tup_inserted + tup_updated +
tup_deleted FROM pg_stat_database WHERE datname='chantal';

not being sure whether this makes sense at all.  ;-)  For exmaple,
does "tup_fetched" imply "tup_returned"?

Tschö,
Torsten.

--
Torsten Bronger, aquisgrana, europa vetus
                   Jabber ID: torsten.bronger@jabber.rwth-aachen.de

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Getting time-dependent load statistics
Next
From: Cott Lang
Date:
Subject: Fixing invalid owners on pg_toast tables in 8.3.5