1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Fix miscalculation of stats collector's write delay, introduced in revision 1.117.

This commit is contained in:
Tom Lane
2007-03-01 20:07:02 +00:00
parent 44089027d5
commit 3530283dae

View File

@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.140.2.2 2007/01/26 20:07:01 tgl Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.140.2.3 2007/03/01 20:07:02 tgl Exp $
* ----------
*/
#include "postgres.h"
@ -1689,7 +1689,7 @@ PgstatCollectorMain(int argc, char *argv[])
/* Preset the delay between status file writes */
MemSet(&write_timeout, 0, sizeof(struct itimerval));
write_timeout.it_value.tv_sec = PGSTAT_STAT_INTERVAL / 1000;
write_timeout.it_value.tv_usec = PGSTAT_STAT_INTERVAL % 1000;
write_timeout.it_value.tv_usec = (PGSTAT_STAT_INTERVAL % 1000) * 1000;
/*
* Read in an existing statistics stats file or initialize the stats to