mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
fix:仪表盘内存只显示当前程序占用
This commit is contained in:
+6
-2
@@ -434,9 +434,13 @@ class SystemUtils:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def memory_usage() -> List[int]:
|
def memory_usage() -> List[int]:
|
||||||
"""
|
"""
|
||||||
获取内存使用量和使用率
|
获取当前程序的内存使用量和使用率
|
||||||
"""
|
"""
|
||||||
return [psutil.virtual_memory().used, int(psutil.virtual_memory().percent)]
|
current_process = psutil.Process()
|
||||||
|
process_memory = current_process.memory_info().rss
|
||||||
|
system_memory = psutil.virtual_memory().total
|
||||||
|
process_memory_percent = (process_memory / system_memory) * 100
|
||||||
|
return [process_memory, int(process_memory_percent)]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def is_hardlink(src: Path, dest: Path) -> bool:
|
def is_hardlink(src: Path, dest: Path) -> bool:
|
||||||
|
|||||||
Reference in New Issue
Block a user