Consistently clear ifstat members

This commit is contained in:
Pim van Pelt
2021-09-05 15:47:15 +00:00
parent 8256c6abfc
commit 80bbc754e4

View File

@ -46,7 +46,7 @@ def vppstat_update():
logger.info("Fetching interface data from VPP")
vppstat = VPPStats(socketname='/run/vpp/stats.sock', timeout=2)
vppstat.connect()
vppstat_ifstat['ifNames'] = vppstat['/if/names']
vppstat_ifstat['ifNames'].clear()
vppstat_ifstat['ifHCInOctets'].clear()
vppstat_ifstat['ifHCInUcastPkts'].clear()
vppstat_ifstat['ifHCInMulticastPkts'].clear()
@ -57,6 +57,7 @@ def vppstat_update():
vppstat_ifstat['ifHCOutBroadcastPkts'].clear()
vppstat_ifstat['ifHighSpeed'].clear()
vppstat_ifstat['ifNames'] = vppstat['/if/names']
for i in range(len(vppstat_ifstat['ifNames'])):
vppstat_ifstat['ifHCInOctets'].append(
vppstat['/if/rx'][:, i].sum_octets())