mirror of https://github.com/nicolargo/glances.git
Take into account @amard33p comment - https://github.com/nicolargo/glances/issues/2394#issuecomment-2794522951
This commit is contained in:
parent
941baba5b4
commit
a550afbd25
|
|
@ -300,11 +300,11 @@ class PluginModel(GlancesPluginModel):
|
|||
to_bit = 8
|
||||
unit = 'b'
|
||||
|
||||
if args.network_cumul and 'bytes_recv' in i and 'bytes_sent' in i:
|
||||
if args.network_cumul and i.get('bytes_recv') is not None and i.get('bytes_sent') is not None:
|
||||
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 and 'bytes_sent_rate_per_sec' in i:
|
||||
elif i.get('bytes_recv_rate_per_sec') is not None and i.get('bytes_sent_rate_per_sec') is not None:
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue