|
@@ -2,7 +2,7 @@
|
|
|
import socketio
|
|
|
import psutil
|
|
|
import threading
|
|
|
-from app.extensions.utils import round_float
|
|
|
+# from app.extensions.utils import round_float
|
|
|
|
|
|
lock = threading.Lock()
|
|
|
|
|
@@ -75,14 +75,14 @@ class ServerNamespace(socketio.AsyncNamespace):
|
|
|
'used': psutil.cpu_percent(interval=0.1), # cpu使用率
|
|
|
'pids': len(psutil.pids()), # 进程数
|
|
|
'cpu_freq': psutil.cpu_freq().current, # CPU频率
|
|
|
- 'boot_time': round_float(psutil.boot_time() / (60 * 60 * 60 * 24)), # 系统启动时间
|
|
|
+ # 'boot_time': round_float(psutil.boot_time() / (60 * 60 * 60 * 24)), # 系统启动时间
|
|
|
}
|
|
|
sys_info["cpu_info"] = cpu_info
|
|
|
memory_info = psutil.virtual_memory()
|
|
|
memory_info = {
|
|
|
- "total": round_float(memory_info.total / (1024 * 1024 * 1024)),
|
|
|
- "used": round_float(memory_info.used / (1024 * 1024 * 1024)),
|
|
|
- "free": round_float(memory_info.free / (1024 * 1024 * 1024)),
|
|
|
+ # "total": round_float(memory_info.total / (1024 * 1024 * 1024)),
|
|
|
+ # "used": round_float(memory_info.used / (1024 * 1024 * 1024)),
|
|
|
+ # "free": round_float(memory_info.free / (1024 * 1024 * 1024)),
|
|
|
"percent": memory_info.percent,
|
|
|
}
|
|
|
sys_info["memory_info"] = memory_info
|