Added another graph but having problems with displaying the number and processes

This commit is contained in:
Dennis Eckerskorn 2024-12-07 22:06:41 +01:00
parent 5c5d116056
commit add737720e
4 changed files with 11 additions and 2 deletions

View File

@ -19,6 +19,11 @@ class SystemMonitor:
"data": [],
"fetch_func": lambda: psutil.virtual_memory().percent,
"interval": 1
},
"Processes": {
"data": [],
"fetch_func": lambda: self.get_process_count,
"interval": 1
}
}
self.graphs = {}
@ -75,3 +80,7 @@ class SystemMonitor:
graph["figure"].canvas.draw()
self.parent_frame.after(0, redraw)
def get_process_count(self):
"""Obtiene el número de procesos actuales."""
return len(psutil.pids())