Fixed cpu usage bug when showing tree and memory in percent

pull/81/head
aristocratos 2020-08-12 16:30:27 +02:00
parent 63058a1178
commit f867c86fdb
1 changed files with 1 additions and 1 deletions

View File

@ -3087,7 +3087,7 @@ class ProcCollector(Collector):
infolist: Dict = {} infolist: Dict = {}
tree = defaultdict(list) tree = defaultdict(list)
n: int = 0 n: int = 0
for p in sorted(psutil.process_iter(cls.p_values + ["memory_info"] if CONFIG.proc_mem_bytes else [], err), key=lambda p: eval(sort_cmd), reverse=reverse): for p in sorted(psutil.process_iter(cls.p_values + (["memory_info"] if CONFIG.proc_mem_bytes else []), err), key=lambda p: eval(sort_cmd), reverse=reverse):
if cls.collect_interrupt: return if cls.collect_interrupt: return
try: try:
tree[p.ppid()].append(p.pid) tree[p.ppid()].append(p.pid)