chg: network - handle alerts with instant updates

Seems to happen only on windows as of now
This commit is contained in:
Bharath Vignesh J K 2023-05-09 01:30:48 +05:30
parent ef3fe253fb
commit 19f3968ce4

View File

@ -268,6 +268,10 @@ class Plugin(GlancesPlugin):
# Add specifics information
# Alert
for i in self.get_raw():
if i['time_since_update'] == 0:
# Skip alert if no timespan to measure
continue
if_real_name = i['interface_name'].split(':')[0]
# Convert rate in bps (to be able to compare to interface speed)
bps_rx = int(i['rx'] // i['time_since_update'] * 8)