diff --git a/src/views/app.js b/src/views/app.js index 1892c7b67..b4c4fdd1e 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -799,9 +799,10 @@ angular.module('Application').controller('AppController', ['$scope', '$location' if (error) return console.error(error); var currentMemoryLimit = $scope.app.memoryLimit || $scope.app.manifest.memoryLimit || (256 * 1024 * 1024); + var cpuCount = result.cpuCount; fillGraph('#graphsMemoryChart', [{ data: result.memory, label: 'Memory' }], 'memoryChart', 1024 * 1024, currentMemoryLimit / 1024 / 1024, 'GiB', 1024); - fillGraph('#graphsCpuChart', [{ data: result.cpu, label: 'CPU' }], 'cpuChart', 1, 100, '%'); + fillGraph('#graphsCpuChart', [{ data: result.cpu, label: 'CPU' }], 'cpuChart', 1, cpuCount * 100, '%'); fillGraph('#graphsDiskChart', [{ data: result.blockRead, label: 'Read' }, { data: result.blockWrite, label: 'Write' }], 'diskChart', 1024 * 1024, null, 'KiB'); fillGraph('#graphsNetworkChart', [{ data: result.networkRead, label: 'Incoming' }, { data: result.networkWrite, label: 'Outgoing' }], 'networkChart', 1024 * 1024, null, 'KiB'); diff --git a/src/views/system.js b/src/views/system.js index 42ba830e6..a8024fd60 100644 --- a/src/views/system.js +++ b/src/views/system.js @@ -116,6 +116,8 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati Client.getSystemGraphs($scope.graphs.period * 60, function (error, result) { if (error) return console.error('Failed to fetch system graphs:', error); + var cpuCount = result.cpuCount; + // in minutes var timePeriod = $scope.graphs.period * 60; @@ -243,7 +245,7 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati return { data: app.memory, label: app.label }; }); - fillGraph('#graphsCPUChart', [{ data: result.cpu, label: 'CPU' }].concat(appsWithHighCPU), 'cpuChart', 1, 100, '%'); + fillGraph('#graphsCPUChart', [{ data: result.cpu, label: 'CPU' }].concat(appsWithHighCPU), 'cpuChart', 1, cpuCount * 100, '%'); fillGraph('#graphsSystemMemoryChart', [{ data: result.memory, label: 'Memory' }].concat(appsWithHighMemory), 'memoryChart', 1024 * 1024, Number.parseInt($scope.memory.memory / 1024 / 1024), 'GiB', 1024); $scope.graphs.busy = false;