Re: Exposing the stats snapshot timestamp to SQL

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Matt Kelly <mkellycs(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Exposing the stats snapshot timestamp to SQL
Date: 2015-01-29 16:57:49
Message-ID: CA+TgmoZUOmi5piU+U41zVB9JGWDZertY-PCPXJuw1tGWkBbBww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 29, 2015 at 12:18 AM, Matt Kelly <mkellycs(at)gmail(dot)com> wrote:
> In a previous thread Tom Lane said:
>
>> (I'm also wondering if it'd make sense to expose the stats timestamp
>> as a callable function, so that the case could be dealt with
>> programmatically as well. But that's future-feature territory.)
>
>
> (http://www.postgresql.org/message-id/27251.1421684169@sss.pgh.pa.us)
>
> It seemed the appropriate scope for my first submission, and that feature
> has been on my wish list for a while, so I thought I'd grab it.
>
> Main purpose of this patch is to expose the timestamp of the current stats
> snapshot so that it can be leveraged by monitoring code. The obvious case
> is alerting if the stats collector becomes unresponsive. The common use
> case is to smooth out graphs which are built from high frequency monitoring
> of the stats collector.
>
> The timestamp is already available as part of PgStat_GlobalStats. This
> patch is just the boilerplate (+docs & tests) needed to expose that value to
> SQL. It shouldn't impact anything else in the server.
>
> I'm not particularly attached to the function name, but I didn't have a
> better idea.
>
> The patch should apply cleanly to master.

Please add your patch here so we don't forget about it:

https://commitfest.postgresql.org/action/commitfest_view/open

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-01-29 17:01:40 Re: Parallel Seq Scan
Previous Message Bruce Momjian 2015-01-29 16:44:13 Re: TABLESAMPLE patch