X-Git-Url: https://gerrit.fd.io/r/gitweb?p=govpp.git;a=blobdiff_plain;f=examples%2Fstats-client%2Fstats_api.go;h=0ccfa897a58eed909d610db27406f347917858e1;hp=66dd451650a7d685cdf47d2fa02fc13385104616;hb=4e16c7100cc7f8dddca051ff393460d7a1a77c98;hpb=4459b648e9fb53c34abbf52a00e63ad384fb9ee2 diff --git a/examples/stats-client/stats_api.go b/examples/stats-client/stats_api.go index 66dd451..0ccfa89 100644 --- a/examples/stats-client/stats_api.go +++ b/examples/stats-client/stats_api.go @@ -137,10 +137,15 @@ func main() { } n := 0 for _, counter := range stats.Errors { - if skipZeros && counter.Value == 0 { + var sum uint32 + for _, valuePerWorker := range counter.Values { + sum += uint32(valuePerWorker) + } + + if skipZeros && sum == 0 { continue } - fmt.Printf(" - %v\n", counter) + fmt.Printf(" - %v %d (per worker: %v)\n", counter.CounterName, sum, counter.Values) n++ } fmt.Printf("Listed %d (%d) error counters\n", n, len(stats.Errors))