frostfs-node/pkg/local_object_storage/writecache/metrics.go
Alexander Chuprov fa0bc8e1df
All checks were successful
DCO action / DCO (pull_request) Successful in 7m19s
Vulncheck / Vulncheck (pull_request) Successful in 8m44s
Build / Build Components (1.22) (pull_request) Successful in 9m54s
Build / Build Components (1.21) (pull_request) Successful in 9m59s
Tests and linters / gopls check (pull_request) Successful in 12m23s
Tests and linters / Staticcheck (pull_request) Successful in 13m30s
Tests and linters / Lint (pull_request) Successful in 16m57s
Tests and linters / Tests with -race (pull_request) Successful in 19m12s
Tests and linters / Tests (1.22) (pull_request) Successful in 3m9s
Tests and linters / Tests (1.21) (pull_request) Successful in 3m23s
[#966] node: Add path of the write_cache to metric labels
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-04-27 15:49:07 +03:00

60 lines
1.3 KiB
Go

package writecache
import (
"time"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
)
type StorageType string
func (t StorageType) String() string {
return string(t)
}
const (
StorageTypeUndefined StorageType = "null"
StorageTypeDB StorageType = "db"
StorageTypeFSTree StorageType = "fstree"
)
type Metrics interface {
SetShardID(string)
Get(d time.Duration, success bool, st StorageType)
Delete(d time.Duration, success bool, st StorageType)
Put(d time.Duration, success bool, st StorageType)
Flush(success bool, st StorageType)
Evict(st StorageType)
SetEstimateSize(db, fstree uint64)
SetMode(m mode.Mode)
SetActualCounters(db, fstree uint64)
SetPath(path string)
Close()
}
func DefaultMetrics() Metrics { return metricsStub{} }
type metricsStub struct{}
func (metricsStub) SetShardID(string) {}
func (metricsStub) SetPath(string) {}
func (metricsStub) Get(time.Duration, bool, StorageType) {}
func (metricsStub) Delete(time.Duration, bool, StorageType) {}
func (metricsStub) Put(time.Duration, bool, StorageType) {}
func (metricsStub) SetEstimateSize(uint64, uint64) {}
func (metricsStub) SetMode(mode.Mode) {}
func (metricsStub) SetActualCounters(uint64, uint64) {}
func (metricsStub) Flush(bool, StorageType) {}
func (metricsStub) Evict(StorageType) {}
func (metricsStub) Close() {}