diff options
author | Vladimir Lavor <vlavor@cisco.com> | 2021-03-02 11:45:37 +0100 |
---|---|---|
committer | Ondrej Fabry <ofabry@cisco.com> | 2021-03-03 12:37:18 +0000 |
commit | 4e16c7100cc7f8dddca051ff393460d7a1a77c98 (patch) | |
tree | dd8ab474f96025a0ec7f7f6fc7507a5663d9b6c6 /adapter/stats_api.go | |
parent | 4459b648e9fb53c34abbf52a00e63ad384fb9ee2 (diff) |
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 <vlavor@cisco.com>
Diffstat (limited to 'adapter/stats_api.go')
-rw-r--r-- | adapter/stats_api.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/adapter/stats_api.go b/adapter/stats_api.go index 15c3789..4b398f5 100644 --- a/adapter/stats_api.go +++ b/adapter/stats_api.go @@ -126,8 +126,8 @@ type Stat interface { // ScalarStat represents stat for ScalarIndex. type ScalarStat float64 -// ErrorStat represents stat for ErrorIndex. -type ErrorStat Counter +// ErrorStat represents stat for ErrorIndex. The array represents workers. +type ErrorStat []Counter // SimpleCounterStat represents stat for SimpleCounterVector. // The outer array represents workers and the inner array represents interface/node/.. indexes. @@ -154,7 +154,15 @@ func (s ScalarStat) IsZero() bool { return s == 0 } func (s ErrorStat) IsZero() bool { - return s == 0 + if s == nil { + return true + } + for _, ss := range s { + if ss != 0 { + return false + } + } + return true } func (s SimpleCounterStat) IsZero() bool { if s == nil { |