]> 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 75ee0d7b180665a08139b71db2a18cc8cc1f87b6..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': {
@@ -1150,19 +1154,32 @@ function chartHeight(id, def) {
 // enrich the data structure returned by netdata
 // to reflect our menu system and content
 function enrichChartData(chart) {
-       // net_* and disk_* have special grouping
-       if(chart.type.match(/^net_/))
-               chart.menu = 'net';
-       else if(chart.type.match(/^ap_/))
-               chart.menu = 'ap';
-       else if(chart.type.match(/^disk_/))
-               chart.menu = 'disk';
-       else
-               chart.menu = chart.type;
+       var tmp = chart.type.split('_')[0];
+
+       switch(tmp) {
+               case 'ap':
+               case 'net':
+               case 'disk':
+                       chart.menu = tmp;
+                       break;
+
+               case 'tc':
+                       chart.menu = tmp;
+
+                       // find the interface name from the name
+                       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$/))
+                               chart.priority--;
 
-       // increase the priority of IFB devices
-       if(chart.type === 'tc' && chart.id.match(/.*-ifb$/))
-               chart.priority--;
+                       break;
+
+               default:
+                       chart.menu = chart.type;
+                       break;
+       }
 
        chart.submenu = chart.family;
 }
@@ -1401,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)
                        };
@@ -1414,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);
 }