frostfs-node/pkg/local_object_storage/writecache/metrics.go
Dmitrii Stepanov 2e8bc23292
[#9999] writecache: Add IO tag label to metrics
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2025-02-24 11:36:16 +03:00

60 lines
1.4 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, ioTag string)
Delete(d time.Duration, success bool, st StorageType, ioTag string)
Put(d time.Duration, success bool, st StorageType, ioTag string)
Flush(success bool, st StorageType)
Evict(st StorageType)
SetEstimateSize(uint64)
SetMode(m mode.ComponentMode)
SetActualCounters(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, string) {}
func (metricsStub) Delete(time.Duration, bool, StorageType, string) {}
func (metricsStub) Put(time.Duration, bool, StorageType, string) {}
func (metricsStub) SetEstimateSize(uint64) {}
func (metricsStub) SetMode(mode.ComponentMode) {}
func (metricsStub) SetActualCounters(uint64) {}
func (metricsStub) Flush(bool, StorageType) {}
func (metricsStub) Evict(StorageType) {}
func (metricsStub) Close() {}