From 2f15b0b2a7821e78852d23f969816b1ab4a95971 Mon Sep 17 00:00:00 2001 From: David Brazda Date: Thu, 20 Jun 2024 22:27:28 +0200 Subject: [PATCH] system info fixes (#212) --- v2realbot/main.py | 21 +++++++++++---------- v2realbot/static/index.html | 22 ++++++++++++---------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/v2realbot/main.py b/v2realbot/main.py index e880613..813cc79 100644 --- a/v2realbot/main.py +++ b/v2realbot/main.py @@ -1033,17 +1033,18 @@ def get_system_info(): disk_used = round(psutil.disk_usage('/').used / 1024**3, 1) disk_free = round(psutil.disk_usage('/').free / 1024**3, 1) disk_used_percentage = round(psutil.disk_usage('/').percent, 1) - memory_total = round(psutil.virtual_memory().total / 1024**3, 1) - memory_perc = round(psutil.virtual_memory().percent, 1) - cpu_time_user = round(psutil.cpu_times().user,1) - cpu_time_system = round(psutil.cpu_times().system,1) - cpu_time_idle = round(psutil.cpu_times().idle,1) - network_sent = round(psutil.net_io_counters().bytes_sent / 1024**3, 6) - network_recv = round(psutil.net_io_counters().bytes_recv / 1024**3, 6) + # memory_total = round(psutil.virtual_memory().total / 1024**3, 1) + # memory_perc = round(psutil.virtual_memory().percent, 1) + # cpu_time_user = round(psutil.cpu_times().user,1) + # cpu_time_system = round(psutil.cpu_times().system,1) + # cpu_time_idle = round(psutil.cpu_times().idle,1) + # network_sent = round(psutil.net_io_counters().bytes_sent / 1024**3, 6) + # network_recv = round(psutil.net_io_counters().bytes_recv / 1024**3, 6) return {"disk_space": {"total": disk_total, "used": disk_used, "free" : disk_free, "used_percentage" : disk_used_percentage}, - "memory": {"total": memory_total, "used_percentage": memory_perc}, - "cpu_time" : {"user": cpu_time_user, "system": cpu_time_system, "idle": cpu_time_idle}, - "network": {"sent": network_sent, "received": network_recv}} + # "memory": {"total": memory_total, "used_percentage": memory_perc}, + # "cpu_time" : {"user": cpu_time_user, "system": cpu_time_system, "idle": cpu_time_idle}, + # "network": {"sent": network_sent, "received": network_recv} + } # Thread function to insert data from the queue into the database def insert_queue2db(): diff --git a/v2realbot/static/index.html b/v2realbot/static/index.html index b9c936f..aa5fd94 100644 --- a/v2realbot/static/index.html +++ b/v2realbot/static/index.html @@ -136,18 +136,20 @@
-