Re: Identifying time of last stat reset via sql

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Ed Loehr <ed(at)LoehrTech(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Identifying time of last stat reset via sql
Date: 2004-12-19 04:27:06
Message-ID: 200412190427.iBJ4R6n10866@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


This relates to an earlier request from someone to allow reporting of
the server start time. It seems both stats start/reset time and server
start time are related.

Is this something for the TODO list? I can't remember why we didn't
want to report server start time, at least for super-users.

---------------------------------------------------------------------------

Ed Loehr wrote:
>
> I asked this on general, but didn't receive any responses. Is it possible
> via SQL to identify the time of the last stat reset (or pg_stat_reset()
> call)? This is what I'm lacking to be able to measure query activity
> volume over time via SQL, i.e., maybe a function similar to the fictitious
> pg_stat_get_last_reset_time() below:
>
> select sum(n_tup_ins + n_tup_upd + n_tup_del)
> / (now() - pg_stat_get_last_reset_time()) as write_qps
> from pg_stat_all_tables
>
> If not, would this be considered worthy of a TODO item? Or is there another
> approached designed for determining QPS, etc?
>
> Ed
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-12-19 05:20:03 stable contrib cleanup
Previous Message Bruce Momjian 2004-12-19 04:04:43 Re: Shared row locking