Update flask_server.py

This commit is contained in:
MacRimi
2025-10-10 22:43:02 +02:00
parent 44e76f36b4
commit 3dc7c6b36f

View File

@@ -1336,7 +1336,7 @@ def get_network_info():
network_data['traffic']['packet_loss_in'] = 0
if total_packets_out > 0:
network_data['traffic']['packet_loss_out'] = round((net_io.dropout / total_packets_out) * 100, 2)
network_data['traffic']['packet_loss_out'] = round((io_stats.dropout / total_packets_out) * 100, 2)
else:
network_data['traffic']['packet_loss_out'] = 0
@@ -2159,6 +2159,13 @@ def get_detailed_gpu_info(gpu):
except ValueError:
pass
if (detailed_info['utilization_memory'] is None or detailed_info['utilization_memory'] == 0) and \
detailed_info['memory_used'] is not None and detailed_info['memory_total'] is not None and \
detailed_info['memory_total'] > 0:
mem_util = (detailed_info['memory_used'] / detailed_info['memory_total']) * 100
detailed_info['utilization_memory'] = round(mem_util, 1)
print(f"[v0] Memory Utilization (calculated): {detailed_info['utilization_memory']}%", flush=True)
# Parse processes
processes_elem = gpu_elem.find('.//processes')
if processes_elem is not None: