]> arthur.barton.de Git - netdata.git/blobdiff - web/index.html
added internal plugin for reading /proc/loadavg and disables charts.d/load_average...
[netdata.git] / web / index.html
index 8fc46a8919cc2717bcb962308db4d2dcebcc13a8..71a0d03cda3035297731d4135b179bba6d122887 100755 (executable)
@@ -692,7 +692,7 @@ if(document.location.hostname === demo_hostname) {
 
 var options = {
        sparklines_registry: {},
-       interfaces_registry: {},
+       submenu_names: {},
        data: null,
        hostname: 'netdata_server', // will be overwritten by the netdata server
        categories: new Array(),
@@ -921,6 +921,10 @@ var chartData = {
                info: 'System processes, read from <code>/proc/stat</code>. <b>Blocked</b> are processes that are willing to execute but they cannot, e.g. because they wait for disk activity.'
        },
 
+       'system.active_processes': {
+               info: 'All system active processes, read from <code>/proc/loadavg</code>.'
+       },
+
        'system.ctxt': {
                info: '<a href="https://en.wikipedia.org/wiki/Context_switch" target="_blank">Context Switches</a>, read from <code>/proc/stat</code>, is the switching of the CPU from one process, task or thread to another. If there are many processes or threads willing to execute and very few CPU cores available to handle them, the system is making more context switching to balance the CPU resources among them. The whole process is computationally intensive. The more the context switches, the slower the system gets.'
        },
@@ -984,7 +988,7 @@ var chartData = {
        },
 
        'disk.backlog': {
-               colors: '#CCCC00'
+               colors: '#0099CC'
        },
 
        'disk.io': {
@@ -1153,30 +1157,18 @@ function enrichChartData(chart) {
        var tmp = chart.type.split('_')[0];
 
        switch(tmp) {
-               case 'disk':
-                       chart.menu = tmp;
-                       break;
-
                case 'ap':
                case 'net':
+               case 'disk':
                        chart.menu = tmp;
-
-                       // set the family using the name
-                       if(typeof options.interfaces_registry[chart.family] !== 'undefined' && options.interfaces_registry[chart.family] !== chart.family)
-                               chart.family += ' (' + options.interfaces_registry[chart.family] + ')';
-
                        break;
 
                case 'tc':
                        chart.menu = tmp;
 
                        // find the interface name from the name
-                       if(typeof options.interfaces_registry[chart.family] === 'undefined' || options.interfaces_registry[chart.family] === chart.family)
-                               options.interfaces_registry[chart.family] = chart.name.split('.')[1].split('_')[0];
-
-                       // set the family using the name
-                       if(typeof options.interfaces_registry[chart.family] !== 'undefined' && options.interfaces_registry[chart.family] !== chart.family)
-                               chart.family += ' (' + options.interfaces_registry[chart.family] + ')';
+                       if(typeof options.submenu_names[chart.family] === 'undefined' || options.submenu_names[chart.family] === chart.family)
+                               options.submenu_names[chart.family] = chart.name.split('.')[1].split('_')[0];
 
                        // increase the priority of IFB devices
                        if(chart.id.match(/.*-ifb$/))
@@ -1426,7 +1418,7 @@ function renderChartsAndMenu(data) {
                        menus[charts[c].menu].submenus[charts[c].submenu] = {
                                priority: charts[c].priority,
                                charts: new Array(),
-                               title: submenuTitle(charts[c].menu, charts[c].submenu),
+                               title: null,
                                info: submenuInfo(charts[c].menu, charts[c].submenu),
                                height: submenuHeight(charts[c].menu, charts[c].submenu, menus[charts[c].menu].height)
                        };
@@ -1439,6 +1431,18 @@ function renderChartsAndMenu(data) {
                menus[charts[c].menu].submenus[charts[c].submenu].charts.push(charts[c]);
        }
 
+       for(var m in menus) {
+               for(var s in menus[m].submenus) {
+                       // set the family using a name
+                       if(typeof options.submenu_names[s] !== 'undefined') {
+                               menus[m].submenus[s].title = s + ' (' + options.submenu_names[s] + ')';
+                       }
+                       else {
+                               menus[m].submenus[s].title = submenuTitle(m, s);
+                       }
+               }
+       }
+
        renderPage(menus, data);
 }