File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.11 2002/08/17 13: 04:14 momjian Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.12 2002/08/20 04:47:52 momjian Exp $
3
3
-->
4
4
5
5
<chapter id="monitoring">
@@ -519,6 +519,14 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
519
519
Current query of backend process (NULL if caller is not superuser)
520
520
</entry>
521
521
</row>
522
+
523
+ <row>
524
+ <entry><function>pg_stat_reset</function>()</entry>
525
+ <entry><type>boolean</type></entry>
526
+ <entry>
527
+ Reset all currently collected statistics.
528
+ </entry>
529
+ </row>
522
530
</tbody>
523
531
</tgroup>
524
532
</table>
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ extern Datum pg_stat_get_blocks_hit(PG_FUNCTION_ARGS);
20
20
21
21
extern Datum pg_stat_get_backend_idset (PG_FUNCTION_ARGS );
22
22
extern Datum pg_backend_pid (PG_FUNCTION_ARGS );
23
+ extern Datum pg_stat_reset (PG_FUNCTION_ARGS );
23
24
extern Datum pg_stat_get_backend_pid (PG_FUNCTION_ARGS );
24
25
extern Datum pg_stat_get_backend_dbid (PG_FUNCTION_ARGS );
25
26
extern Datum pg_stat_get_backend_userid (PG_FUNCTION_ARGS );
@@ -218,6 +219,17 @@ pg_backend_pid(PG_FUNCTION_ARGS)
218
219
PG_RETURN_INT32 (MyProcPid );
219
220
}
220
221
222
+ /*
223
+ * Built-in function for resetting the counters
224
+ *
225
+ */
226
+ Datum
227
+ pg_stat_reset (PG_FUNCTION_ARGS )
228
+ {
229
+ pgstat_reset_counters ();
230
+
231
+ PG_RETURN_BOOL (true);
232
+ }
221
233
222
234
Datum
223
235
pg_stat_get_backend_pid (PG_FUNCTION_ARGS )
Original file line number Diff line number Diff line change 7
7
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
- * $Id: pg_proc.h,v 1.257 2002/08/20 04:45:59 momjian Exp $
10
+ * $Id: pg_proc.h,v 1.258 2002/08/20 04:47:52 momjian Exp $
11
11
*
12
12
* NOTES
13
13
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2715,6 +2715,8 @@ DATA(insert OID = 1936 ( pg_stat_get_backend_idset PGNSP PGUID 12 f f t t s 0
2715
2715
DESCR ("Statistics: Currently active backend IDs" );
2716
2716
DATA (insert OID = 2026 ( pg_backend_pid PGNSP PGUID 12 f f t f s 0 23 "" pg_backend_pid - _null_ ));
2717
2717
DESCR ("Statistics: Current backend PID" );
2718
+ DATA (insert OID = 2274 ( pg_stat_reset PGNSP PGUID 12 f f f f v 0 16 "" pg_stat_reset - _null_ ));
2719
+ DESCR ("Statistics: Reset collected statistics" );
2718
2720
DATA (insert OID = 1937 ( pg_stat_get_backend_pid PGNSP PGUID 12 f f t f s 1 23 "23" pg_stat_get_backend_pid - _null_ ));
2719
2721
DESCR ("Statistics: PID of backend" );
2720
2722
DATA (insert OID = 1938 ( pg_stat_get_backend_dbid PGNSP PGUID 12 f f t f s 1 26 "23" pg_stat_get_backend_dbid - _null_ ));
You can’t perform that action at this time.
0 commit comments