提交 aca953ec 编写于 作者: N nicolargo

[Glances 3.0 RC1] Client/Server is broken #1244

上级 f82eb4a1
...@@ -42,6 +42,7 @@ Bugs corrected: ...@@ -42,6 +42,7 @@ Bugs corrected:
* FreeBSD blackhole bug #1202 * FreeBSD blackhole bug #1202
* Glances crashes when mountpoint with non ASCII characters exists #1201 * Glances crashes when mountpoint with non ASCII characters exists #1201
* [WEB UI] Minor issue on the Web UI #1240 * [WEB UI] Minor issue on the Web UI #1240
* [Glances 3.0 RC1] Client/Server is broken #1244
Backward-incompatible changes: Backward-incompatible changes:
......
...@@ -281,7 +281,7 @@ class Plugin(GlancesPlugin): ...@@ -281,7 +281,7 @@ class Plugin(GlancesPlugin):
ret.append(self.curse_add_line('', splittable=True)) ret.append(self.curse_add_line('', splittable=True))
# Add extended stats but only for the top processes # Add extended stats but only for the top processes
if first and 'extended_stats' in p: if first and 'extended_stats' in p and args.enable_process_extended:
# Left padding # Left padding
xpad = ' ' * 13 xpad = ' ' * 13
# First line is CPU affinity # First line is CPU affinity
...@@ -290,15 +290,12 @@ class Plugin(GlancesPlugin): ...@@ -290,15 +290,12 @@ class Plugin(GlancesPlugin):
msg = xpad + 'CPU affinity: ' + str(len(p['cpu_affinity'])) + ' cores' msg = xpad + 'CPU affinity: ' + str(len(p['cpu_affinity'])) + ' cores'
ret.append(self.curse_add_line(msg, splittable=True)) ret.append(self.curse_add_line(msg, splittable=True))
# Second line is memory info # Second line is memory info
if 'memory_info' in p and p['memory_info'] is not None: if 'memory_info' in p and \
p['memory_info'] is not None:
ret.append(self.curse_new_line()) ret.append(self.curse_new_line())
msg = xpad + 'Memory info: ' msg = '{}Memory info: {}'.format(xpad, p['memory_info'])
for k, v in iteritems(p['memory_info']._asdict()):
# Ignore rss and vms (already displayed)
if k not in ['rss', 'vms'] and v is not None:
msg += self.auto_unit(v, low_precision=False) + ' ' + k + ' '
if 'memory_swap' in p and p['memory_swap'] is not None: if 'memory_swap' in p and p['memory_swap'] is not None:
msg += self.auto_unit(p['memory_swap'], low_precision=False) + ' swap ' msg += ' swap ' + self.auto_unit(p['memory_swap'], low_precision=False)
ret.append(self.curse_add_line(msg, splittable=True)) ret.append(self.curse_add_line(msg, splittable=True))
# Third line is for open files/network sessions # Third line is for open files/network sessions
msg = '' msg = ''
...@@ -317,7 +314,9 @@ class Plugin(GlancesPlugin): ...@@ -317,7 +314,9 @@ class Plugin(GlancesPlugin):
msg = xpad + 'Open: ' + msg msg = xpad + 'Open: ' + msg
ret.append(self.curse_add_line(msg, splittable=True)) ret.append(self.curse_add_line(msg, splittable=True))
# Fouth line is IO nice level (only Linux and Windows OS) # Fouth line is IO nice level (only Linux and Windows OS)
if 'ionice' in p and p['ionice'] is not None: if 'ionice' in p and \
p['ionice'] is not None \
and hasattr(p['ionice'], 'ioclass'):
ret.append(self.curse_new_line()) ret.append(self.curse_new_line())
msg = xpad + 'IO nice: ' msg = xpad + 'IO nice: '
k = 'Class is ' k = 'Class is '
......
...@@ -268,7 +268,6 @@ class GlancesProcesses(object): ...@@ -268,7 +268,6 @@ class GlancesProcesses(object):
# Get extended stats, only for top processes (see issue #403). # Get extended stats, only for top processes (see issue #403).
# - cpu_affinity (Linux, Windows, FreeBSD) # - cpu_affinity (Linux, Windows, FreeBSD)
# - ionice (Linux and Windows > Vista) # - ionice (Linux and Windows > Vista)
# - memory_full_info (Linux)
# - num_ctx_switches (not available on Illumos/Solaris) # - num_ctx_switches (not available on Illumos/Solaris)
# - num_fds (Unix-like) # - num_fds (Unix-like)
# - num_handles (Windows) # - num_handles (Windows)
...@@ -280,8 +279,8 @@ class GlancesProcesses(object): ...@@ -280,8 +279,8 @@ class GlancesProcesses(object):
try: try:
top_process = psutil.Process(proc['pid']) top_process = psutil.Process(proc['pid'])
extended_stats = ['cpu_affinity', 'ionice', extended_stats = ['cpu_affinity', 'ionice',
'memory_full_info', 'num_ctx_switches', 'num_ctx_switches', 'num_fds',
'num_fds', 'num_threads'] 'num_threads']
if WINDOWS: if WINDOWS:
extended_stats += ['num_handles'] extended_stats += ['num_handles']
extended = top_process.as_dict(attrs=extended_stats) extended = top_process.as_dict(attrs=extended_stats)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册