mirror of
https://github.com/nicolargo/glances.git
synced 2024-11-14 10:20:03 +03:00
Fix process list when no io
This commit is contained in:
parent
9798fb41ca
commit
227095448a
@ -23,8 +23,8 @@
|
||||
<div class="table-cell">{{process.nice | exclamation}}</div>
|
||||
<div class="table-cell status">{{process.status}}</div>
|
||||
<div class="table-cell hidden-xs hidden-sm">{{process.timeformatted}}</div>
|
||||
<div class="table-cell hidden-xs hidden-sm">{{process.io_read | bytes}}</div>
|
||||
<div class="table-cell hidden-xs hidden-sm">{{process.io_write | bytes}}</div>
|
||||
<div class="table-cell hidden-xs hidden-sm">{{process.io_read}}</div>
|
||||
<div class="table-cell hidden-xs hidden-sm">{{process.io_write}}</div>
|
||||
<div class="table-cell text-left" ng-if="show.short_process_name">{{process.name}}</div>
|
||||
<div class="table-cell text-left" ng-if="!show.short_process_name">{{process.cmdline}}</div>
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
glancesApp.controller('statsController', function($scope, $http, $interval, $q, $routeParams) {
|
||||
glancesApp.controller('statsController', function($scope, $http, $interval, $q, $routeParams, $filter) {
|
||||
|
||||
$scope.limitSuffix = ['critical', 'careful', 'warning'];
|
||||
$scope.refreshTime = 3;
|
||||
@ -130,8 +130,23 @@ glancesApp.controller('statsController', function($scope, $http, $interval, $q,
|
||||
process.memres = process.memory_info[0]
|
||||
process.timeformatted = timedelta(process.cpu_times)
|
||||
process.timemillis = timemillis(process.cpu_times)
|
||||
process.io_read = (process.io_counters[0] - process.io_counters[2]) / process.time_since_update
|
||||
process.io_write = (process.io_counters[1] - process.io_counters[3]) / process.time_since_update
|
||||
|
||||
process.io_read = '?';
|
||||
process.io_write = '?';
|
||||
|
||||
if (process.io_counters) {
|
||||
process.io_read = (process.io_counters[0] - process.io_counters[2]) / process.time_since_update;
|
||||
|
||||
if (process.io_read != 0) {
|
||||
process.io_read = $filter('bytes')(process.io_read);
|
||||
}
|
||||
|
||||
process.io_write = (process.io_counters[1] - process.io_counters[3]) / process.time_since_update;
|
||||
|
||||
if (process.io_write != 0) {
|
||||
process.io_write = $filter('bytes')(process.io_write);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < response['alert'].length; i++) {
|
||||
var alert = response['alert'][i]
|
||||
|
Loading…
Reference in New Issue
Block a user