proc_stats: expose network packets, errors and drops

Signed-off-by: Rogerio Goncalves <rogerlz@gmail.com>
This commit is contained in:
Rogerio Goncalves 2022-09-19 23:13:37 +01:00 committed by Eric Callahan
parent 21bb17743f
commit 4806ffd2ae
1 changed files with 7 additions and 1 deletions

View File

@ -242,7 +242,13 @@ class ProcStats:
parsed_stats = stats.strip().split()
net_stats[dev_name] = {
'rx_bytes': int(parsed_stats[0]),
'tx_bytes': int(parsed_stats[8])
'tx_bytes': int(parsed_stats[8]),
'rx_packets': int(parsed_stats[1]),
'tx_packets': int(parsed_stats[9]),
'rx_errs': int(parsed_stats[2]),
'tx_errs': int(parsed_stats[10]),
'rx_drop': int(parsed_stats[3]),
'tx_drop': int(parsed_stats[11])
}
return net_stats
except Exception: