mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Add pg_stat_reset_shared('bgwriter') to reset the cluster-wide shared
statistics of the bgwriter. Greg Smith
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/pgstatfuncs.c,v 1.57 2010/01/02 16:57:54 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/pgstatfuncs.c,v 1.58 2010/01/19 14:11:31 mha Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -78,6 +78,7 @@ extern Datum pg_stat_get_buf_alloc(PG_FUNCTION_ARGS);
|
||||
|
||||
extern Datum pg_stat_clear_snapshot(PG_FUNCTION_ARGS);
|
||||
extern Datum pg_stat_reset(PG_FUNCTION_ARGS);
|
||||
extern Datum pg_stat_reset_shared(PG_FUNCTION_ARGS);
|
||||
|
||||
/* Global bgwriter statistics, from bgwriter.c */
|
||||
extern PgStat_MsgBgWriter bgwriterStats;
|
||||
@ -1108,3 +1109,14 @@ pg_stat_reset(PG_FUNCTION_ARGS)
|
||||
|
||||
PG_RETURN_VOID();
|
||||
}
|
||||
|
||||
/* Reset some shared cluster-wide counters */
|
||||
Datum
|
||||
pg_stat_reset_shared(PG_FUNCTION_ARGS)
|
||||
{
|
||||
char *target = text_to_cstring(PG_GETARG_TEXT_PP(0));
|
||||
|
||||
pgstat_reset_shared_counters(target);
|
||||
|
||||
PG_RETURN_VOID();
|
||||
}
|
||||
|
Reference in New Issue
Block a user