var options = {
sparklines_registry: {},
- interfaces_registry: {},
+ submenu_names: {},
data: null,
hostname: 'netdata_server', // will be overwritten by the netdata server
categories: new Array(),
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.'
},
},
'disk.backlog': {
- colors: '#CCCC00'
+ colors: '#0099CC'
},
'disk.io': {
// 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;
}
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)
};
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);
}