From 071b6209490e8afa55039ca65f451e8884cb0b2b Mon Sep 17 00:00:00 2001 From: octo Date: Tue, 20 Dec 2005 09:34:09 +0000 Subject: [PATCH] Fixed a problem with the `disk' plugin: Added a counter to check how often the values were queried, so that no huge peeks appear in the RRD files. --- src/disk.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/disk.c b/src/disk.c index 4e53df0d..ea497175 100644 --- a/src/disk.c +++ b/src/disk.c @@ -65,6 +65,9 @@ typedef struct diskstats { char *name; + /* This overflows in roughly 1361 year */ + unsigned int poll_count; + unsigned int read_sectors; unsigned int write_sectors; @@ -300,6 +303,10 @@ static void disk_read (void) read_bytes = ds->read_bytes; write_bytes = ds->write_bytes; + /* Don't write to the RRDs if we've just started.. */ + ds->poll_count++; + if (ds->poll_count <= 6) + continue; if ((read_count == 0) && (write_count == 0)) continue; -- 2.11.0