Thread: Is there a tool used to display statement times from postgres logs

Is there a tool used to display statement times from postgres logs

From
Chris Barnes
Date:
Would someone have a tool that displays statement execution times/stats from the standard output from postgres logs?
 
I have attempted pgfouine but not had sucess with the log format.
 
Does anyone use pgfouine or have something that works for them?
 
Chris


Windows Live: Make it easier for your friends to see what you’re up to on Facebook.

Re: Is there a tool used to display statement times from postgres logs

From
John R Pierce
Date:
Chris Barnes wrote:
> Would someone have a tool that displays statement execution
> times/stats from the standard output from postgres logs?
>

there's a logging option to put that in the logs, I thought?  if so, you
could then display with `tail -f /path/to/postgreslog`


Re: Is there a tool used to display statement times from postgres logs

From
Chris Barnes
Date:
 
 
I have the logging options set to display anything longer than a duration of 1 second, but need something to display them.
 
Chris
 
> Date: Fri, 20 Nov 2009 10:02:11 -0800
> From: pierce@hogranch.com
> To: compuguruchrisbarnes@hotmail.com
> CC: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Is there a tool used to display statement times from postgres logs
>
> Chris Barnes wrote:
> > Would someone have a tool that displays statement execution
> > times/stats from the standard output from postgres logs?
> >
>
> there's a logging option to put that in the logs, I thought? if so, you
> could then display with `tail -f /path/to/postgreslog`
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general


Get a great deal on Windows 7 and see how it works the way you want. Check out the offers on Windows 7now.

Re: Is there a tool used to display statement times from postgres logs

From
Thom Brown
Date:
2009/11/20 Chris Barnes <compuguruchrisbarnes@hotmail.com>
Would someone have a tool that displays statement execution times/stats from the standard output from postgres logs?
 
I have attempted pgfouine but not had sucess with the log format.
 
Does anyone use pgfouine or have something that works for them?
 
Chris



You may have already tried this, but pgFouine has a custom log prefix which you should be able to set in postgresql.conf under the log_line_prefix setting.  This is described at http://pgfouine.projects.postgresql.org/tutorial.html

I have used pgFouine successfully in the past, although I found it didn't work too well with massive logs.  That may have been rectified since.

Regards

Thom

Re: Is there a tool used to display statement times from postgres logs

From
Bill Moran
Date:
In response to Chris Barnes <compuguruchrisbarnes@hotmail.com>:
>
> I have the logging options set to display anything longer than a duration of 1 second, but need something to display
them.

cat?

Or are you specifically looking for something to analyze them?  Slightly
different, and I'm assuming that's what you meant.  Have a look at
pgfouine.

> > Date: Fri, 20 Nov 2009 10:02:11 -0800
> > From: pierce@hogranch.com
> > To: compuguruchrisbarnes@hotmail.com
> > CC: pgsql-general@postgresql.org
> > Subject: Re: [GENERAL] Is there a tool used to display statement times from postgres logs
> >
> > Chris Barnes wrote:
> > > Would someone have a tool that displays statement execution
> > > times/stats from the standard output from postgres logs?
> > >
> >
> > there's a logging option to put that in the logs, I thought? if so, you
> > could then display with `tail -f /path/to/postgreslog`
> >
> >
> > --
> > Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-general
>
> _________________________________________________________________
> Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail you.
> http://go.microsoft.com/?linkid=9691817

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

Re: Is there a tool used to display statement times from postgres logs

From
"Joshua D. Drake"
Date:
On Fri, 2009-11-20 at 12:59 -0500, Chris Barnes wrote:
> Would someone have a tool that displays statement execution
> times/stats from the standard output from postgres logs?
>
> I have attempted pgfouine but not had sucess with the log format.
>
> Does anyone use pgfouine or have something that works for them?
>
> Chris

All the time. Perhaps you could explain your actual problem?

>
>
> ______________________________________________________________________
> Windows Live: Make it easier for your friends to see what you’re up to
> on Facebook.


--
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564
Consulting, Training, Support, Custom Development, Engineering
If the world pushes look it in the eye and GRR. Then push back harder. - Salamander

Re: Is there a tool used to display statement times from postgres logs

From
Chris Barnes
Date:
 
After trying to get pgfouine to work with stderr, I tried syslog. This seems to work fine.
Produces nice html format reports. Graphing is also available.
 
This link gives set up details for setup for pgfouine.
 
http://www.thelazysysadmin.net/2009/08/pgfouine-automatic-report-setup-with-postgresql-logrotate/

 
> Subject: Re: [GENERAL] Is there a tool used to display statement times from postgres logs
> From: jd@commandprompt.com
> To: compuguruchrisbarnes@hotmail.com
> CC: pgsql-general@postgresql.org
> Date: Fri, 20 Nov 2009 10:53:00 -0800
>
> On Fri, 2009-11-20 at 12:59 -0500, Chris Barnes wrote:
> > Would someone have a tool that displays statement execution
> > times/stats from the standard output from postgres logs?
> >
> > I have attempted pgfouine but not had sucess with the log format.
> >
> > Does anyone use pgfouine or have something that works for them?
> >
> > Chris
>
> All the time. Perhaps you could explain your actual problem?
>
> >
> >
> > ______________________________________________________________________
> > Windows Live: Make it easier for your friends to see what you’re up to
> > on Facebook.
>
>
> --
> PostgreSQL.org Major Contributor
> Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564
> Consulting, Training, Support, Custom Development, Engineering
> If the world pushes look it in the eye and GRR. Then push back harder. - Salamander
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general


Windows Live: Keep your friends up to date with what you do online.

Re: Is there a tool used to display statement times from postgres logs

From
Ben Chobot
Date:
On Nov 20, 2009, at 9:59 AM, Chris Barnes wrote:

Would someone have a tool that displays statement execution times/stats from the standard output from postgres logs?
 
I have attempted pgfouine but not had sucess with the log format.
 
Does anyone use pgfouine or have something that works for them?

We've used pgfouine to great success.... but we also log via syslog. As I recall, pgfouine has some difficulty with multi-line transactions that aren't logged via syslog.

Re: Is there a tool used to display statement times frompostgres logs

From
"Joshua D. Drake"
Date:
On Fri, 2009-11-20 at 12:59 -0500, Chris Barnes wrote:
> Would someone have a tool that displays statement execution
> times/stats from the standard output from postgres logs?
>
> I have attempted pgfouine but not had sucess with the log format.
>
> Does anyone use pgfouine or have something that works for them?
>
> Chris

All the time. Perhaps you could explain your actual problem?

>
>
> ______________________________________________________________________
> Windows Live: Make it easier for your friends to see what you’re up to
> on Facebook.


--
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564
Consulting, Training, Support, Custom Development, Engineering
If the world pushes look it in the eye and GRR. Then push back harder. - Salamander


Re: Is there a tool used to display statement times from postgres logs

From
"Pinter Bernd"
Date:
We currently evaluate PgFouine to analyse all executed statements in a
Postgres 8.4 cluster. But we don't use syslog - instead we use logging
via STDERR. Analyzing of the logs works fine with that combination. We
also tested big logfiles (~ 3GB) with pgFouine - also works fine, but
took about 2h30min for parsing...

To do so, we use the following settings in postgresql.conf:
    log_destination = 'stderr'
    logging_collector = on
    log_min_duration_statement = 0
# log EVERY statement in every DB of the cluster
    log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d '    # for pgFouine
Statistics.

after reloading the config (with `pg_ctl reload`) every sql-statement in
every database of the cluster should be logged. To analyze the log with
pgFouine do something like:
 [bernd@vmlxdb]$ ./pgfouine.php -file PG84-2009-11-09.log -logtype
stderr -report history


If you also need the query-plans in the logfile, then you maybe want to
take a look at the contrib-package 'autoexplain'. This package can write
the query-plan of a sql-statement into the log. But you should be
warned: pgFouine will be a little bit confused with the plans in the
logfile (detect the sql-statement and the associated plan as two
separate statements)...


bernd.


________________________________

    Von: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] Im Auftrag von Chris Barnes
*EXTERN*
    Gesendet: Freitag, 20. November 2009 18:59
    An: Postgres General Postgres General
    Betreff: [GENERAL] Is there a tool used to display statement
times from postgres logs


    Would someone have a tool that displays statement execution
times/stats from the standard output from postgres logs?

    I have attempted pgfouine but not had sucess with the log
format.

    Does anyone use pgfouine or have something that works for them?

    Chris


________________________________

    Windows Live: Make it easier for your friends to see what you're
up to on Facebook. <http://go.microsoft.com/?linkid=9691811>