X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvpp_if_stats%2Fvpp_if_stats.go;h=90c1700430c908bf5ec1576c68de2ff4098cff22;hb=f3b7a5e47af2dbb6a49b53fef56bc73e41cbf431;hp=48ce0853d1ed5ec22e74e7968e6512ecf88ca9d5;hpb=9f6957d1a5b23d4bee9390da20537db6e93b3433;p=vpp.git diff --git a/extras/vpp_if_stats/vpp_if_stats.go b/extras/vpp_if_stats/vpp_if_stats.go old mode 100755 new mode 100644 index 48ce0853d1e..90c1700430c --- a/extras/vpp_if_stats/vpp_if_stats.go +++ b/extras/vpp_if_stats/vpp_if_stats.go @@ -117,9 +117,9 @@ func (v *vppConnector) reduceCombinedCounters(stat *adapter.StatEntry) *[]adapte counters := stat.Data.(adapter.CombinedCounterStat) stats := make([]adapter.CombinedCounter, len(v.Interfaces)) for _, workerStats := range counters { - for i, interfaceStats := range workerStats { - stats[i].Bytes += interfaceStats.Bytes - stats[i].Packets += interfaceStats.Packets + for i := 0; i < len(v.Interfaces); i++ { + stats[i].Bytes += workerStats[i].Bytes + stats[i].Packets += workerStats[i].Packets } } return &stats @@ -129,8 +129,8 @@ func (v *vppConnector) reduceSimpleCounters(stat *adapter.StatEntry) *[]adapter. counters := stat.Data.(adapter.SimpleCounterStat) stats := make([]adapter.Counter, len(v.Interfaces)) for _, workerStats := range counters { - for i, interfaceStats := range workerStats { - stats[i] += interfaceStats + for i := 0; i < len(v.Interfaces); i++ { + stats[i] += workerStats[i] } } return &stats