mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 03:26:17 +00:00
Update flask_server.py
This commit is contained in:
@@ -1336,7 +1336,7 @@ def get_network_info():
|
|||||||
network_data['traffic']['packet_loss_in'] = 0
|
network_data['traffic']['packet_loss_in'] = 0
|
||||||
|
|
||||||
if total_packets_out > 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:
|
else:
|
||||||
network_data['traffic']['packet_loss_out'] = 0
|
network_data['traffic']['packet_loss_out'] = 0
|
||||||
|
|
||||||
@@ -2159,6 +2159,13 @@ def get_detailed_gpu_info(gpu):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
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
|
# Parse processes
|
||||||
processes_elem = gpu_elem.find('.//processes')
|
processes_elem = gpu_elem.find('.//processes')
|
||||||
if processes_elem is not None:
|
if processes_elem is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user