From 6c0e78427373ad5fca8c4c2b52e455197c184be0 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Tue, 10 Jun 2014 19:51:07 -0700 Subject: [PATCH] fix incorrect comment, make minidashboard silent if no data received --- planetstack/core/static/page_analytics.js | 11 +++++++++++ planetstack/core/static/planetstack_graphs.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) 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 } -- 2.47.0