RC2 - Correct bug with cpu_affinity on Mac OS

This commit is contained in:
Nicolargo 2014-08-25 13:51:27 +02:00
parent d9c489d88a
commit 2f1a4576b3
2 changed files with 22 additions and 7 deletions

View File

@ -20,7 +20,7 @@
"""Init the Glances software."""
__appname__ = 'glances'
__version__ = '2.1_RC1'
__version__ = '2.1_RC2'
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
__license__ = 'LGPL'

View File

@ -215,16 +215,31 @@ class GlancesProcesses(object):
if extended_stats and not self.disable_extended_tag:
procstat['extended_stats'] = True
# CPU affinity
# CPU affinity (Windows and Linux only)
try:
procstat.update(proc.as_dict(attrs=['cpu_affinity']))
except AttributeError:
procstat['cpu_affinity'] = None
# Memory extended
try:
procstat.update(proc.as_dict(attrs=['memory_info_ex']))
except AttributeError:
procstat['memory_info_ex'] = None
# Number of context switch
try:
procstat.update(proc.as_dict(attrs=['num_ctx_switches']))
except AttributeError:
procstat['num_ctx_switches'] = None
# Number of file descriptors (Unix only)
try:
procstat.update(proc.as_dict(attrs=['num_fds']))
except AttributeError:
procstat['num_fds'] = None
# Threads number
procstat.update(proc.as_dict(attrs=['cpu_affinity',
'memory_info_ex',
'num_ctx_switches',
'num_fds',
'num_threads']))
try:
procstat.update(proc.as_dict(attrs=['num_threads']))
except AttributeError:
procstat['num_threads'] = None
# Number of handles (Windows only)
if is_windows: