Revision fb8e0ef7
src/sunstone/public/js/plugins/hosts-tab.js | ||
---|---|---|
783 | 783 |
|
784 | 784 |
for (var i=0; i<metrics.length; i++) { |
785 | 785 |
|
786 |
if (empty){ |
|
787 |
host_monitoring_data[this.HOST.ID][metrics[i]].push( |
|
788 |
[now - 60, this.HOST.HOST_SHARE[metrics[i]]] ); |
|
786 |
var last_time = "0"; |
|
787 |
|
|
788 |
var mon_data = host_monitoring_data[this.HOST.ID][metrics[i]]; |
|
789 |
|
|
790 |
if (mon_data.length > 0){ |
|
791 |
last_time = mon_data[ mon_data.length-1 ][0]; |
|
789 | 792 |
} |
790 | 793 |
|
791 |
host_monitoring_data[this.HOST.ID][metrics[i]].push( |
|
792 |
[now, this.HOST.HOST_SHARE[metrics[i]]] ); |
|
794 |
// If the refresh is too frecuent, ignore it |
|
795 |
if (now > last_time + 59){ |
|
796 |
|
|
797 |
// The first time the pool is retrieved we add another point |
|
798 |
// to show something in the dashboard as soon as the user |
|
799 |
// logs in |
|
800 |
if (empty){ |
|
801 |
mon_data.push( |
|
802 |
[now - 60, this.HOST.HOST_SHARE[metrics[i]]] ); |
|
803 |
} |
|
804 |
|
|
805 |
mon_data.push( |
|
806 |
[now, this.HOST.HOST_SHARE[metrics[i]]] ); |
|
807 |
} |
|
793 | 808 |
} |
794 | 809 |
}); |
795 | 810 |
|
Also available in: Unified diff