]> arthur.barton.de Git - netdata.git/commitdiff
prevent adding idle cpu cores or disks
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 20 Dec 2015 03:33:34 +0000 (05:33 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 20 Dec 2015 03:33:34 +0000 (05:33 +0200)
src/proc_diskstats.c
src/proc_softirqs.c

index 0992abff49ee669bd211c028ef927d5f979f56a8..f9bd623aacef0c417f4c0e3fa76bb44cbda44b1e 100755 (executable)
@@ -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
index d2122817e4b0ab635c1e8e0d329ff7788aa78543..7f280ac1e8130017aed39c9c9742d4b0acb740e0 100755 (executable)
@@ -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);