Commit 42d92be0 authored by Leigh B Stoller's avatar Leigh B Stoller

Better handling of the case where idlegraph info contains no info cause

there are no nodes allocated (transient situation).
parent e9be5a3a
...@@ -765,12 +765,18 @@ $(function () ...@@ -765,12 +765,18 @@ $(function ()
var callback = function (status, json) { var callback = function (status, json) {
console.info("LoadIdleData callback"); console.info("LoadIdleData callback");
if (status < 0) { if (status <= 0) {
// Error, show something that indicates we could not get if (status == 0) {
// the idle data. // No data.
$('#idledata-error').html("Could not get graph data: " + $('#idledata-nodata').removeClass("hidden");
json.value); }
$('#idledata-error').removeClass("hidden"); else {
// Error, show something that indicates we could not get
// the idle data.
$('#idledata-error').html("Could not get graph data: " +
json.value);
$('#idledata-error').removeClass("hidden");
}
} }
if (continuation !== undefined) { if (continuation !== undefined) {
continuation(); continuation();
......
...@@ -385,10 +385,21 @@ window.ShowIdleGraphs = (function () ...@@ -385,10 +385,21 @@ window.ShowIdleGraphs = (function ()
return; return;
} }
_.each(json.value, function(data, name) { _.each(json.value, function(data, name) {
var idledata = JSON.parse(data); // No data, skip
rawData[name] = idledata; if (data == "") {
return;
}
rawData[name] = JSON.parse(data);
}); });
console.info("raw", rawData); console.info("raw", rawData);
// No data, tell caller and done.
if (Object.keys(rawData).length == 0) {
if (C_callback) {
C_callback(0, json);
}
return;
}
var load = ProcessData("load", "avg"); var load = ProcessData("load", "avg");
var ctrl = ProcessData("ctrl", "avg"); var ctrl = ProcessData("ctrl", "avg");
var expt = ProcessData("expt", "avg"); var expt = ProcessData("expt", "avg");
......
...@@ -3313,7 +3313,7 @@ $(function () ...@@ -3313,7 +3313,7 @@ $(function ()
* This callback is to let us know if there is any actual data. * This callback is to let us know if there is any actual data.
*/ */
var callback = function (gotdata, ignored) { var callback = function (gotdata, ignored) {
if (!gotdata) { if (gotdata <= 0) {
$('#Idlegraphs #nodata').removeClass("hidden"); $('#Idlegraphs #nodata').removeClass("hidden");
} }
}; };
......
...@@ -209,6 +209,9 @@ pre { ...@@ -209,6 +209,9 @@ pre {
<div class='col-sm-10 col-sm-offset-1 <div class='col-sm-10 col-sm-offset-1
col-xs-12 col-xs-offset-0'> col-xs-12 col-xs-offset-0'>
<div class="well well-sm text-danger hidden" id="idledata-error"></div> <div class="well well-sm text-danger hidden" id="idledata-error"></div>
<div class="well well-sm hidden" id="idledata-nodata">
There is insufficient data to graph, please check back later.
</div>
<div class='panel panel-default hidden' id="loadavg-panel-div"> <div class='panel panel-default hidden' id="loadavg-panel-div">
<div class="panel-heading"> <div class="panel-heading">
<a data-toggle="collapse" id="loadavg-toggle" <a data-toggle="collapse" id="loadavg-toggle"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment