Update GraphFlame

This commit is contained in:
Nicolas Hennion 2021-05-26 13:57:31 +02:00
parent ca246a1ae5
commit 487a758edf
3 changed files with 985 additions and 612 deletions

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

@ -143,7 +143,7 @@ class Config(object):
def read(self):
"""Read the config file, if it exists. Using defaults otherwise."""
for config_file in self.config_file_paths():
logger.info('Search glances.conf file in {}'.format(config_file))
logger.debug('Search glances.conf file in {}'.format(config_file))
if os.path.exists(config_file):
try:
with open(config_file, encoding='utf-8') as f:

View File

@ -391,17 +391,22 @@ class GlancesProcesses(object):
# Manage cached information
if is_cached:
# Add cached values
# Grab cached values (in case of a new incoming process)
if proc['pid'] not in self.processlist_cache:
self.processlist_cache[proc['pid']]= psutil.Process(pid=proc['pid']).as_dict(attrs=cached_attrs,
ad_value=None)
for cached in cached_attrs:
proc[cached] = self.processlist_cache[proc['pid']][cached]
try:
self.processlist_cache[proc['pid']]= psutil.Process(pid=proc['pid']).as_dict(attrs=cached_attrs,
ad_value=None)
except psutil.NoSuchProcess:
pass
# Add cached value to current stat
try:
proc.update(self.processlist_cache[proc['pid']])
except KeyError:
pass
else:
# Save values to cache
self.processlist_cache[proc['pid']] = { cached: proc[cached] for cached in cached_attrs }
# Compute the maximum value for keys in self._max_values_list: CPU, MEM
# Usefull to highlight the processes with maximum values
for k in self._max_values_list: