Skip to content

Commit

Permalink
Network problem when no bitrate available #3014
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed Nov 15, 2024
1 parent 9fe0c81 commit 07656fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions glances/plugins/network/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,11 @@ def msg_curse(self, args=None, max_width=None):
to_bit = 8
unit = 'b'

if args.network_cumul and 'bytes_recv' in i:
if args.network_cumul and 'bytes_recv' in i and 'bytes_sent' in i:
rx = self.auto_unit(int(i['bytes_recv'] * to_bit)) + unit
tx = self.auto_unit(int(i['bytes_sent'] * to_bit)) + unit
ax = self.auto_unit(int(i['bytes_all'] * to_bit)) + unit
elif 'bytes_recv_rate_per_sec' in i:
elif 'bytes_recv_rate_per_sec' in i and 'bytes_sent_rate_per_sec' in i:
rx = self.auto_unit(int(i['bytes_recv_rate_per_sec'] * to_bit)) + unit
tx = self.auto_unit(int(i['bytes_sent_rate_per_sec'] * to_bit)) + unit
ax = self.auto_unit(int(i['bytes_all_rate_per_sec'] * to_bit)) + unit
Expand Down

0 comments on commit 07656fd

Please sign in to comment.