MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / get_mem_and_cpu

Method get_mem_and_cpu

class/projectModel/pythonModel.py:3361–3369  ·  view source on GitHub ↗
(self, pids: list)

Source from the content-addressed store, hash-verified

3359 # return pids
3360
3361 def get_mem_and_cpu(self, pids: list):
3362 mem, cpusum = 0, 0
3363 for pid in pids:
3364 res = self.get_process_info_by_pid(pid)
3365 if "memory_used" in res:
3366 mem += res["memory_used"]
3367 if "cpu_percent" in res:
3368 cpusum += res["cpu_percent"]
3369 return mem, cpusum
3370
3371 @staticmethod
3372 def get_proc_rss(pid):

Callers 1

_get_project_stateMethod · 0.95

Calls 1

Tested by

no test coverage detected