Commit 42d92be0 authored by Leigh Stoller's avatar Leigh 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 ()
var callback = function (status, json) {
console.info("LoadIdleData callback");
if (status < 0) {
// 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 (status <= 0) {
if (status == 0) {
// No data.
$('#idledata-nodata').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) {
continuation();
......
......@@ -385,10 +385,21 @@ window.ShowIdleGraphs = (function ()
return;
}
_.each(json.value, function(data, name) {
var idledata = JSON.parse(data);
rawData[name] = idledata;
// No data, skip
if (data == "") {
return;
}
rawData[name] = JSON.parse(data);
});
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 ctrl = ProcessData("ctrl", "avg");
var expt = ProcessData("expt", "avg");
......
......@@ -3313,7 +3313,7 @@ $(function ()
* This callback is to let us know if there is any actual data.
*/
var callback = function (gotdata, ignored) {
if (!gotdata) {
if (gotdata <= 0) {
$('#Idlegraphs #nodata').removeClass("hidden");
}
};
......
......@@ -209,6 +209,9 @@ pre {
<div class='col-sm-10 col-sm-offset-1
col-xs-12 col-xs-offset-0'>
<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-heading">
<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