Use cpuCount in graphs

This commit is contained in:
Johannes Zellner
2022-10-13 23:05:10 +02:00
parent 6533f9e98f
commit 2a9e177a38
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -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;