Re: Getting time-dependent load statistics

Поиск
Список
Период
Сортировка
От Joshua D. Drake
Тема Re: Getting time-dependent load statistics
Дата
Msg-id 1235154375.31546.113.camel@jd-laptop.pragmaticzealot.org
обсуждение исходный текст
Ответ на Getting time-dependent load statistics  (Torsten Bronger <bronger@physik.rwth-aachen.de>)
Список pgsql-general
On Fri, 2009-02-20 at 17:11 +0100, Torsten Bronger wrote:
> Hallöchen!
>
> 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.  At the moment I just
> do the same with PG's log file, with
>
>     log_statement_stats = on
>
> But to generate these plots is costly (e.g. I don't need all the
> lines starting with !), and to interpret them is equally costly.  Do
> you have a suggestion for a better approach?
>

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"

Joshua D. Drake


> Tschö,
> Torsten.
>
> --
> Torsten Bronger, aquisgrana, europa vetus
>                    Jabber ID: torsten.bronger@jabber.rwth-aachen.de
>
>
--
PostgreSQL - XMPP: jdrake@jabber.postgresql.org
   Consulting, Development, Support, Training
   503-667-4564 - http://www.commandprompt.com/
   The PostgreSQL Company, serving since 1997


В списке pgsql-general по дате отправления:

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: Getting time-dependent load statistics
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Getting time-dependent load statistics