From: Scott Baker Date: Wed, 11 Jun 2014 02:51:07 +0000 (-0700) Subject: fix incorrect comment, make minidashboard silent if no data received X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=6c0e78427373ad5fca8c4c2b52e455197c184be0;p=plstackapi.git fix incorrect comment, make minidashboard silent if no data received --- diff --git a/planetstack/core/static/page_analytics.js b/planetstack/core/static/page_analytics.js index 0b1357b..d9e98e1 100644 --- a/planetstack/core/static/page_analytics.js +++ b/planetstack/core/static/page_analytics.js @@ -44,6 +44,11 @@ function updatePageAnalyticsData(summaryData) { window.pageAnalyticsUrl = summaryData["dataSourceUrl"]; lastRow = summaryData.rows.length-1; + if (summaryData.rows.length <= 0) { + //console.log("no data received from page analytics ajax") + return; + } + setPageStatInt(".nodesLabel", ".nodesValue", "Node Count", "", summaryData.rows[lastRow]["count_hostname"]); setPageStatInt(".cpuLabel", ".cpuValue", "Avg Load", "%", summaryData.rows[lastRow]["avg_cpu"]); @@ -75,6 +80,12 @@ function updatePageAnalytics() { function updatePageBandwidthData(summaryData) { window.pageBandwidthUrl = summaryData["dataSourceUrl"]; lastRow = summaryData.rows.length-1; + + if (summaryData.rows.length <= 0) { + //console.log("no data received from page bandwidth ajax") + return; + } + setPageStatFloat(".bandwidthLabel", ".bandwidthValue", "Bandwidth", " Gbps", summaryData.rows[lastRow]["sum_computed_bytes_sent_div_elapsed"]*8.0/1024/1024/1024,2); setPageStatFloat("#miniDashBandwidthLabel", "#miniDashBandwidth", "Bandwidth", " Gbps", summaryData.rows[lastRow]["sum_computed_bytes_sent_div_elapsed"]*8.0/1024/1024/1024,2); } diff --git a/planetstack/core/static/planetstack_graphs.js b/planetstack/core/static/planetstack_graphs.js index 0c099a9..d8690ed 100644 --- a/planetstack/core/static/planetstack_graphs.js +++ b/planetstack/core/static/planetstack_graphs.js @@ -77,7 +77,7 @@ function handleResponse_psg(container, dataSourceUrl, response, yColumn, xColumn 'Histogram':google.visualization.Histogram}; if (response.isError()) { - #console.log("retry chart"); + //console.log("retry chart"); setTimeout(function () { startQuery(container, dataSourceUrl, yColumn, xColumn, aggFunc, options) }, 5000); return }