mirror of
https://github.com/nicolargo/glances.git
synced 2026-03-16 12:58:13 -04:00
Merge pull request #674 from notFloran/fix-percpu-when-no-iowait
Fix percpu when stats are missing
This commit is contained in:
@@ -19,13 +19,13 @@
|
||||
<div class="table-cell text-left">idle:</div>
|
||||
<div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus">{{ percpu.idle }}%</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-row" ng-show="statsPerCpu.cpus[0].iowait">
|
||||
<div class="table-cell text-left">iowait:</div>
|
||||
<div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus" ng-class="statsPerCpu.getSystemAlert(percpu)">
|
||||
{{ percpu.iowait }}%
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-row" ng-show="statsPerCpu.cpus[0].steal">
|
||||
<div class="table-cell text-left">steal:</div>
|
||||
<div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus" ng-class="statsPerCpu.getSystemAlert(percpu)">
|
||||
{{ percpu.steal }}%
|
||||
|
||||
@@ -95,6 +95,9 @@ class Plugin(GlancesPlugin):
|
||||
|
||||
# Stats per-CPU
|
||||
for stat in ['user', 'system', 'idle', 'iowait', 'steal']:
|
||||
if not stat in self.stats[0]:
|
||||
continue
|
||||
|
||||
ret.append(self.curse_new_line())
|
||||
msg = '{0:8}'.format(stat + ':')
|
||||
ret.append(self.curse_add_line(msg))
|
||||
|
||||
Reference in New Issue
Block a user