mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-01 22:14:06 +03:00
RC2 - Correct bug with cpu_affinity on Mac OS
This commit is contained in:
parent
d9c489d88a
commit
2f1a4576b3
@ -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'
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user