aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2010-01-19 14:11:32 +0000
committerMagnus Hagander <magnus@hagander.net>2010-01-19 14:11:32 +0000
commit7e40cdc07585d5f93dd1f35ce1d402eba55e425b (patch)
tree08fff74f07840a934a001bd12bdba8140663da05 /src/include
parent4f15699d706130540f7cf1ed4f995b61cf50b09c (diff)
downloadpostgresql-7e40cdc07585d5f93dd1f35ce1d402eba55e425b.tar.gz
postgresql-7e40cdc07585d5f93dd1f35ce1d402eba55e425b.zip
Add pg_stat_reset_shared('bgwriter') to reset the cluster-wide shared
statistics of the bgwriter. Greg Smith
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/pg_proc.h4
-rw-r--r--src/include/pgstat.h21
3 files changed, 25 insertions, 4 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 9b36997499a..f37b9077a9b 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.575 2010/01/19 05:50:18 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.576 2010/01/19 14:11:32 mha Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 201001181
+#define CATALOG_VERSION_NO 201001191
#endif
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index e5d6b402b70..9b910317a20 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.563 2010/01/19 05:50:18 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.564 2010/01/19 14:11:32 mha Exp $
*
* NOTES
* The script catalog/genbki.pl reads this file and generates .bki
@@ -3073,6 +3073,8 @@ DATA(insert OID = 2230 ( pg_stat_clear_snapshot PGNSP PGUID 12 1 0 0 f f f f f
DESCR("statistics: discard current transaction's statistics snapshot");
DATA(insert OID = 2274 ( pg_stat_reset PGNSP PGUID 12 1 0 0 f f f f f v 0 0 2278 "" _null_ _null_ _null_ _null_ pg_stat_reset _null_ _null_ _null_ ));
DESCR("statistics: reset collected statistics for current database");
+DATA(insert OID = 3775 ( pg_stat_reset_shared PGNSP PGUID 12 1 0 0 f f f f f v 1 0 2278 "25" _null_ _null_ _null_ _null_ pg_stat_reset_shared _null_ _null_ _null_ ));
+DESCR("statistics: reset collected statistics shared across the cluster");
DATA(insert OID = 1946 ( encode PGNSP PGUID 12 1 0 0 f f f t f i 2 0 25 "17 25" _null_ _null_ _null_ _null_ binary_encode _null_ _null_ _null_ ));
DESCR("convert bytea value into some ascii-only text string");
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index edd544944b6..acadef35a20 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 2001-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.86 2010/01/02 16:58:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.87 2010/01/19 14:11:31 mha Exp $
* ----------
*/
#ifndef PGSTAT_H
@@ -38,6 +38,7 @@ typedef enum StatMsgType
PGSTAT_MTYPE_TABPURGE,
PGSTAT_MTYPE_DROPDB,
PGSTAT_MTYPE_RESETCOUNTER,
+ PGSTAT_MTYPE_RESETSHAREDCOUNTER,
PGSTAT_MTYPE_AUTOVAC_START,
PGSTAT_MTYPE_VACUUM,
PGSTAT_MTYPE_ANALYZE,
@@ -93,6 +94,12 @@ typedef struct PgStat_TableCounts
PgStat_Counter t_blocks_hit;
} PgStat_TableCounts;
+/* Possible targets for resetting cluster-wide shared values */
+typedef enum PgStat_Shared_Reset_Target
+{
+ RESET_BGWRITER
+} PgStat_Shared_Reset_Target;
+
/* ------------------------------------------------------------
* Structures kept in backend local memory while accumulating counts
@@ -260,6 +267,16 @@ typedef struct PgStat_MsgResetcounter
Oid m_databaseid;
} PgStat_MsgResetcounter;
+/* ----------
+ * PgStat_MsgResetsharedcounter Sent by the backend to tell the collector
+ * to reset a shared counter
+ * ----------
+ */
+typedef struct PgStat_MsgResetsharedcounter
+{
+ PgStat_MsgHdr m_hdr;
+ PgStat_Shared_Reset_Target m_resettarget;
+} PgStat_MsgResetsharedcounter;
/* ----------
* PgStat_MsgAutovacStart Sent by the autovacuum daemon to signal
@@ -414,6 +431,7 @@ typedef union PgStat_Msg
PgStat_MsgTabpurge msg_tabpurge;
PgStat_MsgDropdb msg_dropdb;
PgStat_MsgResetcounter msg_resetcounter;
+ PgStat_MsgResetsharedcounter msg_resetsharedcounter;
PgStat_MsgAutovacStart msg_autovacuum;
PgStat_MsgVacuum msg_vacuum;
PgStat_MsgAnalyze msg_analyze;
@@ -635,6 +653,7 @@ extern void pgstat_drop_database(Oid databaseid);
extern void pgstat_clear_snapshot(void);
extern void pgstat_reset_counters(void);
+extern void pgstat_reset_shared_counters(const char *);
extern void pgstat_report_autovac(Oid dboid);
extern void pgstat_report_vacuum(Oid tableoid, bool shared, bool adopt_counts,