aboutsummaryrefslogtreecommitdiffstats
path: root/adapter/stats_api.go
diff options
context:
space:
mode:
authorVladimir Lavor <vlavor@cisco.com>2022-05-05 10:56:23 +0200
committerVladimir Lavor <vlavor@cisco.com>2022-05-05 11:28:52 +0200
commit874266e00029174d6ad512eeac678b0c99512cd7 (patch)
tree2dba41113b0be28e304051e840863522506e9f57 /adapter/stats_api.go
parent945b7c7ae69c414ef851f85596be4edeb1d9290e (diff)
support error counters also as normal counters
https://gerrit.fd.io/r/c/vpp/+/35640 Signed-off-by: Vladimir Lavor <vlavor@cisco.com> Change-Id: I91820bb15655e7b309af814c659eb9f5e7cd08a4
Diffstat (limited to 'adapter/stats_api.go')
-rw-r--r--adapter/stats_api.go39
1 files changed, 9 insertions, 30 deletions
diff --git a/adapter/stats_api.go b/adapter/stats_api.go
index 1319d71..7dc7dc3 100644
--- a/adapter/stats_api.go
+++ b/adapter/stats_api.go
@@ -16,7 +16,6 @@ package adapter
import (
"errors"
- "fmt"
)
const (
@@ -53,39 +52,19 @@ type StatsAPI interface {
// StatType represents type of stat directory and simply
// defines what type of stat data is stored in the stat entry.
-type StatType int
+type StatType string
const (
- _ StatType = 0
- ScalarIndex StatType = 1
- SimpleCounterVector StatType = 2
- CombinedCounterVector StatType = 3
- ErrorIndex StatType = 4
- NameVector StatType = 5
- Empty StatType = 6
- Symlink StatType = 7
+ Unknown StatType = "UnknownStatType"
+ ScalarIndex StatType = "ScalarIndex"
+ SimpleCounterVector StatType = "SimpleCounterVector"
+ CombinedCounterVector StatType = "CombinedCounterVector"
+ ErrorIndex StatType = "ErrorIndex"
+ NameVector StatType = "NameVector"
+ Empty StatType = "Empty"
+ Symlink StatType = "Symlink"
)
-func (d StatType) String() string {
- switch d {
- case ScalarIndex:
- return "ScalarIndex"
- case SimpleCounterVector:
- return "SimpleCounterVector"
- case CombinedCounterVector:
- return "CombinedCounterVector"
- case ErrorIndex:
- return "ErrorIndex"
- case NameVector:
- return "NameVector"
- case Empty:
- return "Empty"
- case Symlink:
- return "Symlink"
- }
- return fmt.Sprintf("UnknownStatType(%d)", d)
-}
-
// StatDir defines directory of stats entries created by PrepareDir.
type StatDir struct {
Epoch int64