diff options
author | Nicolas Hennion <nicolas@nicolargo.com> | 2014-08-13 10:58:58 +0200 |
---|---|---|
committer | Nicolas Hennion <nicolas@nicolargo.com> | 2014-08-13 10:58:58 +0200 |
commit | d2e525abe1fc0e66686c4268130b6cd9fc941d5e (patch) | |
tree | cd53aee1f4439ec13b4013e2ee762d61dac236f9 | |
parent | 8e92419f3b300323dc5916941bc3379a280813bc (diff) |
Add 3er line
-rw-r--r-- | glances/plugins/glances_processlist.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/glances/plugins/glances_processlist.py b/glances/plugins/glances_processlist.py index 27ee5587..b5deca6b 100644 --- a/glances/plugins/glances_processlist.py +++ b/glances/plugins/glances_processlist.py @@ -240,7 +240,7 @@ class Plugin(GlancesPlugin): # Add extended stats but only for the top processes # !!! CPU consumption !!!! - if first: + if first and p['extended_stats']: # Left padding xpad = ' ' * 13 # First line is CPU affinity @@ -250,11 +250,24 @@ class Plugin(GlancesPlugin): # Second line is memory info ret.append(self.curse_new_line()) msg = xpad + _('Memory info: ') - msg += _('swap ') + self.auto_unit(p['memory_swap'], low_precision=False) for k, v in p['memory_info_ex']._asdict().items(): # Ignore rss and vms (already displayed) - if k not in ['rss', 'vms']: - msg += ', ' + k + ' ' + self.auto_unit(v, low_precision=False) + if k not in ['rss', 'vms'] and v is not None: + msg += k + ' ' + self.auto_unit(v, low_precision=False) + ' ' + if p['memory_swap'] is not None: + msg += _('swap ') + self.auto_unit(p['memory_swap'], low_precision=False) + ret.append(self.curse_add_line(msg)) + # Third line is for openned files/network sessions + ret.append(self.curse_new_line()) + msg = xpad + _('Openned: ') + if p['num_threads'] is not None: + msg += _('threads ') + str(p['num_threads']) + ' ' + if p['num_fds'] is not None: + msg += _('files ') + str(p['num_fds']) + ' ' + if p['tcp'] is not None: + msg += _('TCP ') + str(p['tcp']) + ' ' + if p['tcp'] is not None: + msg += _('UDP ') + str(p['udp']) + ' ' ret.append(self.curse_add_line(msg)) # End of extended stats first = False |