summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com>2023-05-09 01:30:48 +0530
committerBharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com>2023-05-09 02:44:48 +0530
commit19f3968ce4025ff8001f1cfc153b0a8eb0866823 (patch)
treeddae96970566e41aa908a405ca6824c1a2e60ea6
parentef3fe253fb7b468cd3f753274a6fac069c1e591c (diff)
chg: network - handle alerts with instant updates
Seems to happen only on windows as of now
-rw-r--r--glances/plugins/glances_network.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/glances/plugins/glances_network.py b/glances/plugins/glances_network.py
index 62715bd2..ed8e648a 100644
--- a/glances/plugins/glances_network.py
+++ b/glances/plugins/glances_network.py
@@ -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)