From: octo Date: Tue, 20 Dec 2005 09:34:09 +0000 (+0000) Subject: Fixed a problem with the `disk' plugin: Added a counter to check how often the values... X-Git-Tag: collectd-3.6.0~21 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=071b6209490e8afa55039ca65f451e8884cb0b2b;p=collectd.git 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. --- 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;