-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently network speed is calculated in the following function, however there should be more sophisticated logic to handle the change to mb (and potentially GB) for example if the kb total is > 1024 it changes to returning MB etc....
Current Function:
def get_network_info():
global last_bytes_sent, last_bytes_recv
net_io = psutil.net_io_counters()
# Calculate the difference in bytes sent/received since the last check
bytes_sent_diff = net_io.bytes_sent - last_bytes_sent
bytes_recv_diff = net_io.bytes_recv - last_bytes_recv
# Update the last network IO counters
last_bytes_sent = net_io.bytes_sent
last_bytes_recv = net_io.bytes_recv
# Convert to kilobytes for readability
kb_sent_diff = bytes_sent_diff / 1024
kb_recv_diff = bytes_recv_diff / 1024
return ('Kbps', f"|↑{kb_sent_diff:.2f} KB|↓{kb_recv_diff:.2f} KB")Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request