All checks were successful
Build / Build Components (push) Successful in 2m24s
Pre-commit hooks / Pre-commit (push) Successful in 2m43s
Vulncheck / Vulncheck (push) Successful in 3m15s
Tests and linters / gopls check (push) Successful in 5m1s
OCI image / Build container images (push) Successful in 5m36s
Tests and linters / Lint (push) Successful in 6m17s
Tests and linters / Staticcheck (push) Successful in 6m16s
Tests and linters / Run gofumpt (push) Successful in 6m29s
Tests and linters / Tests (push) Successful in 9m40s
Tests and linters / Tests with -race (push) Successful in 9m41s
Tree sync is too much different from GC and rebuild to use the same tag for GC and tree sync. Change-Id: Ib44d5fa9a88daff507d759d0b0410cc9272e236f Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
29 lines
615 B
Go
29 lines
615 B
Go
package qos
|
|
|
|
const unknownStatsTag = "unknown"
|
|
|
|
var statTags = map[string]struct{}{
|
|
IOTagClient.String(): {},
|
|
IOTagBackground.String(): {},
|
|
IOTagInternal.String(): {},
|
|
IOTagPolicer.String(): {},
|
|
IOTagWritecache.String(): {},
|
|
IOTagCritical.String(): {},
|
|
IOTagTreeSync.String(): {},
|
|
unknownStatsTag: {},
|
|
}
|
|
|
|
func createStats() map[string]*stat {
|
|
result := make(map[string]*stat)
|
|
for tag := range statTags {
|
|
result[tag] = &stat{}
|
|
}
|
|
return result
|
|
}
|
|
|
|
func getStat(tag string, stats map[string]*stat) *stat {
|
|
if v, ok := stats[tag]; ok {
|
|
return v
|
|
}
|
|
return stats[unknownStatsTag]
|
|
}
|