sync the y-range of charts under the same family, with the same context and the same units; fixes #2132
Costa Tsaousis (ktsaou) committed
Apr 26, 2017 at 16:32 UTC
bc9bb117e6fbdab23df4724b627cd2dfc53e133c
3 files changed
+22
-12
src/proc_net_softnet_stat.c
+2
-2
@@ -79,7 +79,7 @@ int do_proc_net_softnet_stat(int update_every, usec_t dt) {
79
80
st = rrdset_find_bytype_localhost("system", "softnet_stat");
81
if(unlikely(!st)) {
82
- st = rrdset_create_localhost("system", "softnet_stat", NULL, "softnet_stat", NULL, "System softnet_stat"
82
+ st = rrdset_create_localhost("system", "softnet_stat", NULL, "softnet_stat", "system.softnet_stat", "System softnet_stat"
83
, "events/s", 955, update_every, RRDSET_TYPE_LINE);
84
for(w = 0; w < allocated_columns ;w++)
85
if(unlikely(softnet_column_name(w)))
@@ -103,7 +103,7 @@ int do_proc_net_softnet_stat(int update_every, usec_t dt) {
103
char title[100+1];
104
snprintfz(title, 100, "CPU%zu softnet_stat", l);
105
106
- st = rrdset_create_localhost("cpu", id, NULL, "softnet_stat", NULL, title, "events/s", 4101 + l
106
+ st = rrdset_create_localhost("cpu", id, NULL, "softnet_stat", "cpu.softnet_stat", title, "events/s", 4101 + l
107
, update_every, RRDSET_TYPE_LINE);
108
for(w = 0; w < allocated_columns ;w++)
109
if(unlikely(softnet_column_name(w)))
web/dashboard.js
+14
-7
@@ -4472,11 +4472,11 @@ var NETDATA = window.NETDATA || {};
4472
options.valueRange = state.dygraph_options.valueRange;
4473
4474
var oldMax = null, oldMin = null;
4475
- if(state.__commonMin !== null) {
4475
+ if (state.__commonMin !== null) {
4476
state.data.min = state.dygraph_instance.axes_[0].extremeRange[0];
4477
oldMin = options.valueRange[0] = NETDATA.commonMin.get(state);
4478
}
4479
- if(state.__commonMax !== null) {
4479
+ if (state.__commonMax !== null) {
4480
state.data.max = state.dygraph_instance.axes_[0].extremeRange[1];
4481
oldMax = options.valueRange[1] = NETDATA.commonMax.get(state);
4482
}
@@ -5100,12 +5100,19 @@ var NETDATA = window.NETDATA || {};
5100
state.dygraph_user_action = false;
5101
state.dygraph_last_rendered = Date.now();
5102
5103
- if(typeof state.dygraph_instance.axes_[0].extremeRange !== 'undefined') {
5104
- state.__commonMin = self.data('common-min') || null;
5105
- state.__commonMax = self.data('common-max') || null;
5103
+ if(state.dygraph_options.valueRange[0] === null && state.dygraph_options.valueRange[1] === null) {
5104
+ if (typeof state.dygraph_instance.axes_[0].extremeRange !== 'undefined') {
5105
+ state.__commonMin = self.data('common-min') || null;
5106
+ state.__commonMax = self.data('common-max') || null;
5107
+ }
5108
+ else {
5109
+ state.log('incompatible version of Dygraph detected');
5110
+ state.__commonMin = null;
5111
+ state.__commonMax = null;
5112
+ }
5113
}
5114
else {
5108
- state.log('incompatible version of Dygraph detected');
5115
+ // if the user gave a valueRange, respect it
5116
state.__commonMin = null;
5117
state.__commonMax = null;
5118
}
@@ -6596,7 +6603,7 @@ var NETDATA = window.NETDATA || {};
6603
if(typeof chart_id === 'string') {
6604
var offset = $('#' + NETDATA.alarms.chart_div_id_prefix + NETDATA.name2id(chart_id)).offset();
6605
if(typeof offset !== 'undefined') {
6599
- $('html, body').animate({ scrollTop: offset.top - NETDATA.alarms.chart_div_offset }, NETDATA.alarms.chart_div_animation_duration);
6606
+ $('html, body').animate({ scrollTop: offset.top + NETDATA.alarms.chart_div_offset }, NETDATA.alarms.chart_div_animation_duration);
6607
return true;
6608
}
6609
}
web/index.html
+6
-3
@@ -983,7 +983,7 @@
983
if(hash && hash != '' && document.getElementById(hash) !== null) {
984
var offset = $('#' + hash).offset();
985
if(typeof offset !== 'undefined')
986
- $('html, body').animate({ scrollTop: offset.top }, 0);
986
+ $('html, body').animate({ scrollTop: offset.top - 50 }, 0);
987
}
988
989
// we must return false to prevent the default action
@@ -1456,6 +1456,8 @@
1456
+ ' data-after="-' + duration.toString() + '"'
1457
+ ' data-id="' + NETDATA.name2id(options.hostname + '/' + chart.id) + '"'
1458
+ ' 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 + '"'
1461
+ ' role="application"></div>';
1462
1463
// console.log(' \------- ' + chart.id + ' (' + chart.priority + '): ' + chart.context + ' height: ' + menus[menu].submenus[submenu].height);
@@ -2676,10 +2678,11 @@
2678
2679
// change the URL based on the current position of the screen
2680
$sidebar.on('activate.bs.scrollspy', function (e) {
2679
- // console.log(e);
2681
+ //console.log(e);
2682
var el = $(e.target);
2683
//if(el.find('ul').size() == 0) {
2684
var hash = el.find('a').attr('href');
2685
+ // console.log(hash);
2686
if(typeof hash === 'string' && hash.substring(0, 1) === '#' && urlOptions.hash.startsWith(hash + '_submenu_') === false) {
2687
urlOptions.hash = hash;
2688
//console.log(urlOptions.hash);
@@ -3524,4 +3527,4 @@
3527
</div>
3528
</body>
3529
</html>
3527
-<script type="text/javascript" src="dashboard.js?v20170421-2"></script>
3530
+<script type="text/javascript" src="dashboard.js?v20170426-6"></script>