aboutsummaryrefslogtreecommitdiff
path: root/src/backend/postmaster/pgstat.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-04-30 16:37:08 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-04-30 16:37:08 +0000
commit641912b4d17fd214a5e5bae4e7bb9ddbc28b144b (patch)
tree6f8b0b8cdb0e00248bd269c1cf25bec57f49cda4 /src/backend/postmaster/pgstat.c
parent957d08c81f9cc277725c83b9381c5154b6318a5e (diff)
downloadpostgresql-641912b4d17fd214a5e5bae4e7bb9ddbc28b144b.tar.gz
postgresql-641912b4d17fd214a5e5bae4e7bb9ddbc28b144b.zip
Fix oversight in my patch of yesterday: forgot to ensure that stats would
still be forced out at backend exit.
Diffstat (limited to 'src/backend/postmaster/pgstat.c')
-rw-r--r--src/backend/postmaster/pgstat.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index ad5b490a27d..1fac5af284b 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.154 2007/04/30 03:23:49 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.155 2007/04/30 16:37:08 tgl Exp $
* ----------
*/
#include "postgres.h"
@@ -615,7 +615,7 @@ void allow_immediate_pgstat_restart(void)
* ----------
*/
void
-pgstat_report_tabstat(void)
+pgstat_report_tabstat(bool force)
{
static TimestampTz last_report = 0;
TimestampTz now;
@@ -627,10 +627,11 @@ pgstat_report_tabstat(void)
/*
* Don't send a message unless it's been at least PGSTAT_STAT_INTERVAL
- * msec since we last sent one.
+ * msec since we last sent one, or the caller wants to force stats out.
*/
now = GetCurrentTransactionStopTimestamp();
- if (!TimestampDifferenceExceeds(last_report, now, PGSTAT_STAT_INTERVAL))
+ if (!force &&
+ !TimestampDifferenceExceeds(last_report, now, PGSTAT_STAT_INTERVAL))
return;
last_report = now;
@@ -1491,7 +1492,7 @@ pgstat_beshutdown_hook(int code, Datum arg)
{
volatile PgBackendStatus *beentry = MyBEEntry;
- pgstat_report_tabstat();
+ pgstat_report_tabstat(true);
/*
* Clear my status entry, following the protocol of bumping st_changecount