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,7 +19,12 @@ 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 = {}
self.init_graphs()
@ -74,4 +79,8 @@ class SystemMonitor:
graph["axis"].set_xlim(0, len(data))
graph["figure"].canvas.draw()
self.parent_frame.after(0, redraw)
self.parent_frame.after(0, redraw)
def get_process_count(self):
"""Obtiene el número de procesos actuales."""
return len(psutil.pids())