diff --git a/src/views/app.html b/src/views/app.html index 16a9c97e2..0beadca2d 100644 --- a/src/views/app.html +++ b/src/views/app.html @@ -1064,13 +1064,13 @@ - + - - - - - + + + + + diff --git a/src/views/app.js b/src/views/app.js index 7238725cd..f3979b3e9 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -693,6 +693,11 @@ angular.module('Application').controller('AppController', ['$scope', '$location' memoryChart: null, diskChart: null, + blockReadTotal: 0, + blockWriteTotal: 0, + networkReadTotal: 0, + networkWriteTotal: 0, + setPeriod: function (hours) { $scope.graphs.period = hours; $scope.graphs.show(); @@ -800,11 +805,17 @@ angular.module('Application').controller('AppController', ['$scope', '$location' var currentMemoryLimit = $scope.app.memoryLimit || $scope.app.manifest.memoryLimit || (256 * 1024 * 1024); var cpuCount = result.cpuCount; + var ioDivisor = 1000 * 1000; + + $scope.graphs.blockReadTotal = (result.blockReadTotal / ioDivisor / 1000).toFixed(2) + ' MB'; + $scope.graphs.blockWriteTotal = (result.blockWriteTotal / ioDivisor / 1000).toFixed(2) + ' MB'; + $scope.graphs.networkReadTotal = (result.networkReadTotal / ioDivisor / 1000).toFixed(2) + ' MB'; + $scope.graphs.networkWriteTotal = (result.networkWriteTotal / ioDivisor / 1000).toFixed(2) + ' MB'; fillGraph('#graphsMemoryChart', [{ data: result.memory, label: 'Memory' }], 'memoryChart', 1024 * 1024, currentMemoryLimit / 1024 / 1024, 'GiB', 1024); 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'); + fillGraph('#graphsDiskChart', [{ data: result.blockRead, label: 'Read' }, { data: result.blockWrite, label: 'Write' }], 'diskChart', ioDivisor, null, 'kB/s'); + fillGraph('#graphsNetworkChart', [{ data: result.networkRead, label: 'Incoming' }, { data: result.networkWrite, label: 'Outgoing' }], 'networkChart', ioDivisor, null, 'kB/s'); $scope.graphs.busy = false; });