Re: How to get total count of queries hitting DB per day or per hour? - Mailing list pgsql-general

From Sheena, Prabhjot
Subject Re: How to get total count of queries hitting DB per day or per hour?
Date
Msg-id 13E39D789E19FF4E9A87F6D456F3F98201245222@SEAMBX02.sea.corp.int.untd.com
Whole thread Raw
In response to Re: How to get total count of queries hitting DB per day or per hour?  (Melvin Davidson <melvin6925@gmail.com>)
Responses Re: How to get total count of queries hitting DB per day or per hour?
List pgsql-general

Thanks a lot. That’s what I am looking for

 

Thanks

Prabhjot Singh

 

From: Melvin Davidson [mailto:melvin6925@gmail.com]
Sent: Thursday, July 9, 2015 1:24 PM
To: Scott Marlowe
Cc: Sheena, Prabhjot; pgsql-general@postgresql.org
Subject: Re: [GENERAL] How to get total count of queries hitting DB per day or per hour?

 

Run two cron jobs, each runs exacty 24 hours apart.
Each gets the result of the following query:

SELECT SUM(xact_commit + xact_rollback)
  FROM pg_stat_database;

 Then subtract the result of the first cron from the second.
 That's the number of transactions in a 24 hr period.

 

On Thu, Jul 9, 2015 at 4:07 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:

On Thu, Jul 9, 2015 at 12:04 PM, Sheena, Prabhjot
<Prabhjot.Singh@classmates.com> 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.

If you just need totals, turn on just log_duration and then you can
grep the logs etc for that.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




--

Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.
Image removed by sender.

Attachment

pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: How to get total count of queries hitting DB per day or per hour?
Next
From: Adrian Klaver
Date:
Subject: Re: How to get total count of queries hitting DB per day or per hour?