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.
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@xxxxxxxxx> wrote:
On Thu, Jul 9, 2015 at 12:04 PM, Sheena, Prabhjot
<Prabhjot.Singh@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx)
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.
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.