Plot app memory against the apps memory limit
This commit is contained in:
@@ -606,7 +606,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
var timePeriod = $scope.graphs.period * 60;
|
||||
var timeBucketSize = $scope.graphs.period > 24 ? (6*60) : 5;
|
||||
|
||||
function fillGraph(canvasId, data, label, chartPropertyName) {
|
||||
function fillGraph(canvasId, data, label, chartPropertyName, max) {
|
||||
// translate the data from bytes to MB
|
||||
var datapoints = data.datapoints.map(function (d) { return parseInt((d[0] / 1024 / 1024).toFixed(2)); });
|
||||
var labels = datapoints.map(function (d, index) {
|
||||
@@ -639,6 +639,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
min: 0,
|
||||
max: max,
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
@@ -657,7 +658,9 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
Client.graphs([ memoryQuery, diskQuery ], '-' + timePeriod + 'min', {}, function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
fillGraph('#graphsMemoryChart', result[0], 'Memory', 'memoryChart');
|
||||
var currentMemoryLimit = $scope.app.memoryLimit || $scope.app.manifest.memoryLimit || (256 * 1024 * 1024);
|
||||
|
||||
fillGraph('#graphsMemoryChart', result[0], 'Memory', 'memoryChart', currentMemoryLimit / 1024 / 1024);
|
||||
fillGraph('#graphsDiskChart', result[1], 'Disk', 'diskChart');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user