Exposing the stats snapshot timestamp to SQL

Поиск
Список
Период
Сортировка
От Matt Kelly
Тема Exposing the stats snapshot timestamp to SQL
Дата
Msg-id CA+KcUkiibrsMJ-ST0T5k9E0xbLWcRJZtqJESghGzvo3VoidN7A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Exposing the stats snapshot timestamp to SQL  (Robert Haas <robertmhaas@gmail.com>)
Re: Exposing the stats snapshot timestamp to SQL  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-hackers
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.)
 

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.

- Matt K
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: pg_upgrade and rsync
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: pg_upgrade and rsync