Use new graphs api response
This commit is contained in:
@@ -173,7 +173,7 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
|
||||
|
||||
// fill holes with previous value
|
||||
var cur = 0;
|
||||
content.data.datapoints.forEach(function (d) {
|
||||
content.data.forEach(function (d) {
|
||||
if (d[0] === null) d[0] = cur;
|
||||
else cur = d[0];
|
||||
});
|
||||
@@ -181,7 +181,7 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
|
||||
var datapoints = Array(steps).map(function () { return '0'; });
|
||||
|
||||
// walk backwards and fill up the datapoints
|
||||
content.data.datapoints.reverse().forEach(function (d, index) {
|
||||
content.data.reverse().forEach(function (d, index) {
|
||||
datapoints[datapoints.length-1-index] = (d[0] / divisor).toFixed(2);
|
||||
});
|
||||
|
||||
@@ -249,7 +249,7 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
|
||||
return result.apps[appId];
|
||||
}).filter(function (app) {
|
||||
if (!app.cpu) return false; // not sure why we get empty objects
|
||||
return app.cpu.datapoints.some(function (d) { return d[0] > cpuThreshold; });
|
||||
return app.cpu.some(function (d) { return d[0] > cpuThreshold; });
|
||||
}).map(function (app) {
|
||||
return { data: app.cpu, label: app.label };
|
||||
});
|
||||
@@ -265,7 +265,7 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
|
||||
return result.apps[appId];
|
||||
}).filter(function (app) {
|
||||
if (!app.memory) return false; // not sure why we get empty objects
|
||||
return app.memory.datapoints.some(function (d) { return d[0] > memoryThreshold; });
|
||||
return app.memory.some(function (d) { return d[0] > memoryThreshold; });
|
||||
}).map(function (app) {
|
||||
return { data: app.memory, label: app.label };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user