Re: How to get total count of queries hitting DB per day or per hour?

From: Andy Colson <andy(at)squeakycode(dot)net>
To: "Sheena, Prabhjot" <Prabhjot(dot)Singh(at)classmates(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to get total count of queries hitting DB per day or per hour?
Date: 2015-07-09 18:10:25
Message-ID: 559EB911.4020100@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/9/2015 1:04 PM, Sheena, Prabhjot wrote:
> Guys
>
> Is there a way to get total count of queries hitting
> Postgresql DB(verison 9.3) per day or per hour ? I cannot turn on
> log_statement=all coz that’s too much logging for our log file to
> handle. Is there another way to do that.
>
> Thanks
>
> Prabhjot
>

My collectd config:

<Plugin postgresql>
<Query ttlbackends>
Statement "SELECT sum(numbackends) AS count, sum(xact_commit)
as ttlcommit FROM pg_stat_database;"
<Result>
Type "pg_numbackends"
ValuesFrom "count"
</Result>
<Result>
Type "pg_xact"
ValuesFrom "ttlcommit"
</Result>
</Query>

<Database postgres>
#Interval 60
Host "/tmp"
Port "5432"
SSLMode "disable"
Query ttlbackends
</Database>
</Plugin>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2015-07-09 19:07:34 Re: How to test SSL cert from CA?
Previous Message Andy Colson 2015-07-09 18:06:57 Re: Index Only Scan vs Cache