enable commonMin/Max only for specific charts
Costa Tsaousis (ktsaou) committed
Apr 27, 2017 at 01:53 UTC
4849b1d3f714445b1b1fd84029a400fa71026811
2 files changed
+36
-3
web/dashboard_info.js
+17
@@ -449,9 +449,26 @@ netdataDashboard.context = {
449
// CPU charts
450
451
'cpu.cpu': {
452
+ commonMin: true,
453
+ commonMax: true,
454
valueRange: "[0, 100]"
455
},
456
457
+ 'cpu.interrupts': {
458
+ commonMin: true,
459
+ commonMax: true
460
+ },
461
+
462
+ 'cpu.softirqs': {
463
+ commonMin: true,
464
+ commonMax: true
465
+ },
466
+
467
+ 'cpu.softnet_stat': {
468
+ commonMin: true,
469
+ commonMax: true
470
+ },
471
+
472
// ------------------------------------------------------------------------
473
// MEMORY
474
web/index.html
+19
-3
@@ -1447,6 +1447,22 @@
1447
mhead += generateHeadCharts('mainheads', chart, duration);
1448
head += generateHeadCharts('heads', chart, duration);
1449
1450
+ function chartCommonMin(family, context, units) {
1451
+ var x = netdataDashboard.anyAttribute(netdataDashboard.context, 'commonMin', context, undefined);
1452
+ if(typeof x !== 'undefined')
1453
+ return ' data-common-min="' + family + '/' + context + '/' + units + '"';
1454
+ else
1455
+ return '';
1456
+ }
1457
+
1458
+ function chartCommonMax(family, context, units) {
1459
+ var x = netdataDashboard.anyAttribute(netdataDashboard.context, 'commonMax', context, undefined);
1460
+ if(typeof x !== 'undefined')
1461
+ return ' data-common-max="' + family + '/' + context + '/' + units + '"';
1462
+ else
1463
+ return '';
1464
+ }
1465
+
1466
// generate the chart
1467
chtml += netdataDashboard.contextInfo(chart.context) + '<div id="chart_' + NETDATA.name2id(chart.id) + '" data-netdata="' + chart.id + '"'
1468
+ ' data-width="' + pcent_width.toString() + '%"'
@@ -1456,8 +1472,8 @@
1472
+ ' data-after="-' + duration.toString() + '"'
1473
+ ' data-id="' + NETDATA.name2id(options.hostname + '/' + chart.id) + '"'
1474
+ ' data-colors="' + netdataDashboard.anyAttribute(netdataDashboard.context, 'colors', chart.context, '') + '"'
1459
- + ' data-common-min="' + chart.family + '/' + chart.context + '/' + chart.units + '"'
1460
- + ' data-common-max="' + chart.family + '/' + chart.context + '/' + chart.units + '"'
1475
+ + chartCommonMin(chart.family, chart.context, chart.units)
1476
+ + chartCommonMax(chart.family, chart.context, chart.units)
1477
+ ' role="application"></div>';
1478
1479
// console.log(' \------- ' + chart.id + ' (' + chart.priority + '): ' + chart.context + ' height: ' + menus[menu].submenus[submenu].height);
@@ -2899,7 +2915,7 @@
2915
});
2916
2917
NETDATA.requiredJs.push({
2902
- url: NETDATA.serverDefault + 'dashboard_info.js?v20170426-1',
2918
+ url: NETDATA.serverDefault + 'dashboard_info.js?v20170427-1',
2919
async: false,
2920
isAlreadyLoaded: function() { return false; }
2921
});