X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=adapter%2Fstats_api.go;h=7dc7dc38b446d7cc7e67e5a4f2bd22de98ecc563;hb=a4112fac7b86fe09650d2bb57969fe46404edd7d;hp=1319d71b9326b301e33c2c1fde36e5b8ec6c95b9;hpb=ba6e92d715c59dc71c4e18e66b262d07578d524b;p=govpp.git 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