[#312] metrics: Add writecache metrcis
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
d212d908b5
commit
2ce43935f9
14 changed files with 415 additions and 32 deletions
|
@ -6,37 +6,44 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
|
||||
)
|
||||
|
||||
type storageType string
|
||||
type StorageType string
|
||||
|
||||
func (t StorageType) String() string {
|
||||
return string(t)
|
||||
}
|
||||
|
||||
const (
|
||||
storageTypeUndefined storageType = "null"
|
||||
storageTypeDB storageType = "db"
|
||||
storageTypeFSTree storageType = "fstree"
|
||||
StorageTypeUndefined StorageType = "null"
|
||||
StorageTypeDB StorageType = "db"
|
||||
StorageTypeFSTree StorageType = "fstree"
|
||||
)
|
||||
|
||||
type Metrics interface {
|
||||
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)
|
||||
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)
|
||||
|
||||
Estimate(db, fstree uint64)
|
||||
SetEstimateSize(db, fstree uint64)
|
||||
SetMode(m mode.Mode)
|
||||
SetActualCounters(db, fstree uint64)
|
||||
}
|
||||
|
||||
type metricsStub struct{}
|
||||
|
||||
func (s *metricsStub) Get(time.Duration, bool, storageType) {}
|
||||
func (s *metricsStub) Get(time.Duration, bool, StorageType) {}
|
||||
|
||||
func (s *metricsStub) Delete(time.Duration, bool, storageType) {}
|
||||
func (s *metricsStub) Delete(time.Duration, bool, StorageType) {}
|
||||
|
||||
func (s *metricsStub) Put(time.Duration, bool, storageType) {}
|
||||
func (s *metricsStub) Put(time.Duration, bool, StorageType) {}
|
||||
|
||||
func (s *metricsStub) Estimate(uint64, uint64) {}
|
||||
func (s *metricsStub) SetEstimateSize(uint64, uint64) {}
|
||||
|
||||
func (s *metricsStub) SetMode(mode.Mode) {}
|
||||
|
||||
func (s *metricsStub) Flush(bool, storageType) {}
|
||||
func (s *metricsStub) SetActualCounters(uint64, uint64) {}
|
||||
|
||||
func (s *metricsStub) Evict(storageType) {}
|
||||
func (s *metricsStub) Flush(bool, StorageType) {}
|
||||
|
||||
func (s *metricsStub) Evict(StorageType) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue