*
* 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"
* ----------
*/
void
-pgstat_report_tabstat(void)
+pgstat_report_tabstat(bool force)
{
static TimestampTz last_report = 0;
TimestampTz now;
/*
* 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;
{
volatile PgBackendStatus *beentry = MyBEEntry;
- pgstat_report_tabstat();
+ pgstat_report_tabstat(true);
/*
* Clear my status entry, following the protocol of bumping st_changecount
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.532 2007/04/16 18:21:07 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.533 2007/04/30 16:37:08 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
}
else
{
- pgstat_report_tabstat();
+ pgstat_report_tabstat(false);
set_ps_display("idle", false);
pgstat_report_activity("<IDLE>");
*
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.57 2007/03/30 18:34:55 mha Exp $
+ * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.58 2007/04/30 16:37:08 tgl Exp $
* ----------
*/
#ifndef PGSTAT_H
*/
extern void pgstat_ping(void);
-extern void pgstat_report_tabstat(void);
+extern void pgstat_report_tabstat(bool force);
extern void pgstat_vacuum_tabstat(void);
extern void pgstat_drop_database(Oid databaseid);
extern void pgstat_drop_relation(Oid relid);