From fb8e0ef77fedbdf381cae8210254bd14dc2f81dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 11 Apr 2013 15:24:30 +0200 Subject: [PATCH] Add less data to host pool monitoring --- src/sunstone/public/js/plugins/hosts-tab.js | 25 ++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index 0f310a61d4..1dca05c977 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -783,13 +783,28 @@ function updateHostsView (request,host_list){ for (var i=0; i 0){ + last_time = mon_data[ mon_data.length-1 ][0]; } - host_monitoring_data[this.HOST.ID][metrics[i]].push( - [now, this.HOST.HOST_SHARE[metrics[i]]] ); + // If the refresh is too frecuent, ignore it + if (now > last_time + 59){ + + // The first time the pool is retrieved we add another point + // to show something in the dashboard as soon as the user + // logs in + if (empty){ + mon_data.push( + [now - 60, this.HOST.HOST_SHARE[metrics[i]]] ); + } + + mon_data.push( + [now, this.HOST.HOST_SHARE[metrics[i]]] ); + } } });