diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2015-12-20 05:33:34 +0200 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2015-12-20 05:33:34 +0200 |
commit | 43018545ed5dd5455c6d0004c90913a839c069bd (patch) | |
tree | 6bebfa9ed06fd4f6754cca343389461909c96ac5 /src | |
parent | 27c2b265b7d2cfdcac70343778d4d583bd9ce465 (diff) |
prevent adding idle cpu cores or disks
Diffstat (limited to 'src')
-rwxr-xr-x | src/proc_diskstats.c | 4 | ||||
-rwxr-xr-x | src/proc_softirqs.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/proc_diskstats.c b/src/proc_diskstats.c index 0992abff49..f9bd623aac 100755 --- a/src/proc_diskstats.c +++ b/src/proc_diskstats.c @@ -110,6 +110,10 @@ int do_proc_diskstats(int update_every, unsigned long long dt) { // I/O completion time and the backlog that may be accumulating. backlog_ms = strtoull(procfile_lineword(ff, l, 13), NULL, 10); // rq_ticks + + // do not add a disk that is completely idle + if(!reads && !writes && !busy_ms) continue; + int def_enabled = 0; // remove slashes from disk names diff --git a/src/proc_softirqs.c b/src/proc_softirqs.c index d2122817e4..7f280ac1e8 100755 --- a/src/proc_softirqs.c +++ b/src/proc_softirqs.c @@ -131,6 +131,14 @@ int do_proc_softirqs(int update_every, unsigned long long dt) { st = rrdset_find_bytype("cpu", id); if(!st) { + // find if everything is zero + unsigned long long core_sum = 0 ; + for(l = 0; l < lines ;l++) { + if(!irrs[l].used) continue; + core_sum += irrs[l].value[c]; + } + if(core_sum == 0) continue; // try next core + char name[256], title[256]; snprintf(name, 256, "cpu%d_softirqs", c); snprintf(title, 256, "CPU%d softirqs", c); |