aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-04-26 02:57:14 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-04-26 02:57:14 +0000
commit2b1e36c7c0f294c70595bddaae0caecbcf8b50c6 (patch)
treef0bc9931dbc6af443f6bd76e40a882d9e2688e48 /src/include
parent9fdb1de3ba5805e676f58860c423a50a765458e2 (diff)
downloadpostgresql-2b1e36c7c0f294c70595bddaae0caecbcf8b50c6.tar.gz
postgresql-2b1e36c7c0f294c70595bddaae0caecbcf8b50c6.zip
Tweak stats collector start logic so that we will not try to spawn a
new stats collector oftener than once a minute. Per gripe from Erik Walthinsen 4/25/03.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/pgstat.h32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index 533c2e44f56..e85f6ec3e91 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -3,15 +3,18 @@
*
* Definitions for the PostgreSQL statistics collector daemon.
*
- * Copyright (c) 2001, PostgreSQL Global Development Group
+ * Copyright (c) 2001-2003, PostgreSQL Global Development Group
*
- * $Id: pgstat.h,v 1.13 2003/03/20 03:34:56 momjian Exp $
+ * $Id: pgstat.h,v 1.14 2003/04/26 02:57:14 tgl Exp $
* ----------
*/
#ifndef PGSTAT_H
#define PGSTAT_H
+#include "utils/hsearch.h"
#include "utils/nabstime.h"
+#include "utils/rel.h"
+
/* ----------
* Paths for the statistics files. The %s is replaced with the
@@ -26,16 +29,17 @@
* ----------
*/
#define PGSTAT_STAT_INTERVAL 500 /* How often to write the status */
- /* file, in milliseconds. */
+ /* file; in milliseconds. */
#define PGSTAT_DESTROY_DELAY 10000 /* How long to keep destroyed */
- /* objects known to give delayed */
- /* UDP packets time to arrive, */
+ /* objects known, to give delayed */
+ /* UDP packets time to arrive; */
/* in milliseconds. */
-#define PGSTAT_DESTROY_COUNT (PGSTAT_DESTROY_DELAY \
- / PGSTAT_STAT_INTERVAL)
+#define PGSTAT_DESTROY_COUNT (PGSTAT_DESTROY_DELAY / PGSTAT_STAT_INTERVAL)
+#define PGSTAT_RESTART_INTERVAL 60 /* How often to attempt to restart */
+ /* a failed statistics collector; in seconds. */
/* ----------
* How much of the actual query string to send to the collector.
@@ -323,7 +327,7 @@ typedef union PgStat_Msg
/* ----------
- * Global variables
+ * GUC parameters
* ----------
*/
extern bool pgstat_collect_startcollector;
@@ -333,12 +337,18 @@ extern bool pgstat_collect_tuplelevel;
extern bool pgstat_collect_blocklevel;
/* ----------
+ * Other global variables
+ * ----------
+ */
+extern bool pgstat_is_running;
+
+/* ----------
* Functions called from postmaster
* ----------
*/
-extern int pgstat_init(void);
-extern int pgstat_start(void);
-extern int pgstat_ispgstat(int pid);
+extern void pgstat_init(void);
+extern void pgstat_start(void);
+extern bool pgstat_ispgstat(int pid);
extern void pgstat_close_sockets(void);
extern void pgstat_beterm(int pid);