This commit is contained in:
Donald Zou
2025-04-20 02:52:22 +08:00
parent bf7adf9ca9
commit 7689ebcac5
2 changed files with 11 additions and 9 deletions

View File

@@ -101,15 +101,16 @@ class NetworkInterfaces:
self.getData()
return self.interfaces
class Process:
def __init__(self, name, command, pid, percent):
self.name = name
self.command = command
self.pid = pid
self.percent = percent
def toJson(self):
return self.__dict__
class Processes:
class Process:
def __init__(self, name, command, pid, percent):
self.name = name
self.command = command
self.pid = pid
self.percent = percent
def toJson(self):
return self.__dict__
def __init__(self):
self.CPU_Top_10_Processes: list[Processes.Process] = []
self.Memory_Top_10_Processes: list[Processes.Process] = []