Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,15 +90,22 @@ def torch_update_gpu_status():
|
|
| 90 |
return gpu_status
|
| 91 |
|
| 92 |
def update_cpu_status():
|
| 93 |
-
current_time = datetime.
|
| 94 |
time_str = current_time.strftime("%Y-%m-%d %H:%M:%S")
|
| 95 |
|
| 96 |
cpu_percent = psutil.cpu_percent()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
-
cpu_info = psutil.cpu_info()
|
| 99 |
-
cpu_name = cpu_info[0].brand_raw if cpu_info else "Unknown CPU"
|
| 100 |
-
|
| 101 |
-
cpu_status = f"**{time_str} (UTC+0)**\n\n**CPU Name**: {cpu_name}\n**CPU Usage**: {cpu_percent}%\n\n"
|
| 102 |
return cpu_status
|
| 103 |
|
| 104 |
def update_status():
|
|
|
|
| 90 |
return gpu_status
|
| 91 |
|
| 92 |
def update_cpu_status():
|
| 93 |
+
current_time = datetime.utcnow()
|
| 94 |
time_str = current_time.strftime("%Y-%m-%d %H:%M:%S")
|
| 95 |
|
| 96 |
cpu_percent = psutil.cpu_percent()
|
| 97 |
+
cpu_freq = psutil.cpu_freq()
|
| 98 |
+
cpu_count = psutil.cpu_count(logical=True)
|
| 99 |
+
cpu_name = psutil.cpu_freq().cpu
|
| 100 |
+
virtual_memory = psutil.virtual_memory()
|
| 101 |
+
|
| 102 |
+
cpu_status = f"**{time_str} (UTC+0)**\n\n"
|
| 103 |
+
cpu_status += f"**CPU Name**: {cpu_name}\n"
|
| 104 |
+
cpu_status += f"**CPU Usage**: {cpu_percent}%\n"
|
| 105 |
+
cpu_status += f"**CPU Frequency**: Current: {cpu_freq.current}MHz, Max: {cpu_freq.max}MHz, Min: {cpu_freq.min}MHz\n"
|
| 106 |
+
cpu_status += f"**CPU Cores**: {cpu_count}\n"
|
| 107 |
+
cpu_status += f"**Virtual Memory**: Total: {virtual_memory.total}, Available: {virtual_memory.available}, Used: {virtual_memory.used}, Percentage: {virtual_memory.percent}%\n"
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
return cpu_status
|
| 110 |
|
| 111 |
def update_status():
|