mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-24 17:51:49 +03:00
Improve comment
This commit is contained in:
parent
d8a00d73a2
commit
5a1315130b
@ -513,6 +513,8 @@ class Plugin(GlancesPlugin):
|
|||||||
|
|
||||||
# Process list
|
# Process list
|
||||||
# Loop over processes (sorted by the sort key previously compute)
|
# Loop over processes (sorted by the sort key previously compute)
|
||||||
|
# This is a Glances bottleneck (see flame graph),
|
||||||
|
# get_process_curses_data should be optimzed
|
||||||
i = 0
|
i = 0
|
||||||
for p in self.__sort_stats(process_sort_key):
|
for p in self.__sort_stats(process_sort_key):
|
||||||
ret.extend(self.get_process_curses_data(p, i == args.cursor_position, args))
|
ret.extend(self.get_process_curses_data(p, i == args.cursor_position, args))
|
||||||
|
@ -253,6 +253,7 @@ class GlancesProcesses(object):
|
|||||||
#####################
|
#####################
|
||||||
sorted_attrs = ['cpu_percent', 'cpu_times', 'memory_percent', 'name', 'status', 'num_threads']
|
sorted_attrs = ['cpu_percent', 'cpu_times', 'memory_percent', 'name', 'status', 'num_threads']
|
||||||
displayed_attr = ['memory_info', 'nice', 'pid']
|
displayed_attr = ['memory_info', 'nice', 'pid']
|
||||||
|
# 'name' can not be cached because it is used for filtering
|
||||||
cached_attrs = ['cmdline', 'username']
|
cached_attrs = ['cmdline', 'username']
|
||||||
|
|
||||||
# Some stats are optional
|
# Some stats are optional
|
||||||
@ -274,14 +275,14 @@ class GlancesProcesses(object):
|
|||||||
is_cached = True
|
is_cached = True
|
||||||
|
|
||||||
# Build the processes stats list (it is why we need psutil>=5.3.0)
|
# Build the processes stats list (it is why we need psutil>=5.3.0)
|
||||||
|
# This is on of the main bottleneck of Glances (see flame graph)
|
||||||
self.processlist = [
|
self.processlist = [
|
||||||
p.info
|
p.info
|
||||||
for p in psutil.process_iter(attrs=sorted_attrs, ad_value=None)
|
for p in psutil.process_iter(attrs=sorted_attrs, ad_value=None)
|
||||||
# OS-related processes filter
|
# OS-related processes filter
|
||||||
if not (BSD and p.info['name'] == 'idle')
|
if not (BSD and p.info['name'] == 'idle') and
|
||||||
and not (WINDOWS and p.info['name'] == 'System Idle Process')
|
not (WINDOWS and p.info['name'] == 'System Idle Process') and
|
||||||
and not (MACOS and p.info['name'] == 'kernel_task')
|
not (MACOS and p.info['name'] == 'kernel_task') and
|
||||||
and
|
|
||||||
# Kernel threads filter
|
# Kernel threads filter
|
||||||
not (self.no_kernel_threads and LINUX and p.info['gids'].real == 0)
|
not (self.no_kernel_threads and LINUX and p.info['gids'].real == 0)
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user