From 4e16c7100cc7f8dddca051ff393460d7a1a77c98 Mon Sep 17 00:00:00 2001 From: Vladimir Lavor Date: Tue, 2 Mar 2021 11:45:37 +0100 Subject: Provide error counters per worker for statsclient Instead of a single value, the ErrorCounter now contains an array representing couter values per workers. Change-Id: I2b869e5b228bcb3e155b1fef08a4cd00e7d2e16a Signed-off-by: Vladimir Lavor --- examples/stats-client/stats_api.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'examples/stats-client/stats_api.go') 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)) -- cgit 1.2.3-korg