X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=adapter%2Fstats_api.go;h=4b398f549d67d1384e11cc124719d27fb9562931;hb=4e16c7100cc7f8dddca051ff393460d7a1a77c98;hp=90dbeb394b5e5b78a81af4c1aa0265d7a02e3a09;hpb=db87efa2ec1e91e81517236b164b279e57b8daa8;p=govpp.git diff --git a/adapter/stats_api.go b/adapter/stats_api.go index 90dbeb3..4b398f5 100644 --- a/adapter/stats_api.go +++ b/adapter/stats_api.go @@ -27,6 +27,7 @@ const ( var ( ErrStatsDataBusy = errors.New("stats data busy") ErrStatsDirStale = errors.New("stats dir stale") + ErrStatsDisconnected = errors.New("stats disconnected") ErrStatsAccessFailed = errors.New("stats access failed") ) @@ -125,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. @@ -153,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 {