[#1367] writecache: Drop DB label from metrics
All checks were successful
DCO action / DCO (pull_request) Successful in 29s
Vulncheck / Vulncheck (pull_request) Successful in 1m14s
Tests and linters / Run gofumpt (pull_request) Successful in 1m47s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m57s
Build / Build Components (pull_request) Successful in 2m7s
Tests and linters / Staticcheck (pull_request) Successful in 2m31s
Tests and linters / gopls check (pull_request) Successful in 2m32s
Tests and linters / Tests (pull_request) Successful in 3m24s
Tests and linters / Tests with -race (pull_request) Successful in 3m26s
Tests and linters / Lint (pull_request) Successful in 3m32s
All checks were successful
DCO action / DCO (pull_request) Successful in 29s
Vulncheck / Vulncheck (pull_request) Successful in 1m14s
Tests and linters / Run gofumpt (pull_request) Successful in 1m47s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m57s
Build / Build Components (pull_request) Successful in 2m7s
Tests and linters / Staticcheck (pull_request) Successful in 2m31s
Tests and linters / gopls check (pull_request) Successful in 2m32s
Tests and linters / Tests (pull_request) Successful in 3m24s
Tests and linters / Tests with -race (pull_request) Successful in 3m26s
Tests and linters / Lint (pull_request) Successful in 3m32s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
7baa415a06
commit
78a554616b
3 changed files with 10 additions and 12 deletions
|
@ -169,18 +169,16 @@ func (m *writeCacheMetrics) Put(d time.Duration, success bool, st writecache.Sto
|
||||||
m.metrics.AddMethodDuration(m.shardID, m.path, st.String(), "Put", success, d)
|
m.metrics.AddMethodDuration(m.shardID, m.path, st.String(), "Put", success, d)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *writeCacheMetrics) SetEstimateSize(db, fstree uint64) {
|
func (m *writeCacheMetrics) SetEstimateSize(size uint64) {
|
||||||
m.metrics.SetEstimateSize(m.shardID, m.path, writecache.StorageTypeDB.String(), db)
|
m.metrics.SetEstimateSize(m.shardID, m.path, writecache.StorageTypeFSTree.String(), size)
|
||||||
m.metrics.SetEstimateSize(m.shardID, m.path, writecache.StorageTypeFSTree.String(), fstree)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *writeCacheMetrics) SetMode(mod mode.ComponentMode) {
|
func (m *writeCacheMetrics) SetMode(mod mode.ComponentMode) {
|
||||||
m.metrics.SetMode(m.shardID, mod.String())
|
m.metrics.SetMode(m.shardID, mod.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *writeCacheMetrics) SetActualCounters(db, fstree uint64) {
|
func (m *writeCacheMetrics) SetActualCounters(count uint64) {
|
||||||
m.metrics.SetActualCount(m.shardID, m.path, writecache.StorageTypeDB.String(), db)
|
m.metrics.SetActualCount(m.shardID, m.path, writecache.StorageTypeFSTree.String(), count)
|
||||||
m.metrics.SetActualCount(m.shardID, m.path, writecache.StorageTypeFSTree.String(), fstree)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *writeCacheMetrics) Flush(success bool, st writecache.StorageType) {
|
func (m *writeCacheMetrics) Flush(success bool, st writecache.StorageType) {
|
||||||
|
|
|
@ -26,9 +26,9 @@ type Metrics interface {
|
||||||
Flush(success bool, st StorageType)
|
Flush(success bool, st StorageType)
|
||||||
Evict(st StorageType)
|
Evict(st StorageType)
|
||||||
|
|
||||||
SetEstimateSize(db, fstree uint64)
|
SetEstimateSize(uint64)
|
||||||
SetMode(m mode.ComponentMode)
|
SetMode(m mode.ComponentMode)
|
||||||
SetActualCounters(db, fstree uint64)
|
SetActualCounters(uint64)
|
||||||
SetPath(path string)
|
SetPath(path string)
|
||||||
Close()
|
Close()
|
||||||
}
|
}
|
||||||
|
@ -47,11 +47,11 @@ func (metricsStub) Delete(time.Duration, bool, StorageType) {}
|
||||||
|
|
||||||
func (metricsStub) Put(time.Duration, bool, StorageType) {}
|
func (metricsStub) Put(time.Duration, bool, StorageType) {}
|
||||||
|
|
||||||
func (metricsStub) SetEstimateSize(uint64, uint64) {}
|
func (metricsStub) SetEstimateSize(uint64) {}
|
||||||
|
|
||||||
func (metricsStub) SetMode(mode.ComponentMode) {}
|
func (metricsStub) SetMode(mode.ComponentMode) {}
|
||||||
|
|
||||||
func (metricsStub) SetActualCounters(uint64, uint64) {}
|
func (metricsStub) SetActualCounters(uint64) {}
|
||||||
|
|
||||||
func (metricsStub) Flush(bool, StorageType) {}
|
func (metricsStub) Flush(bool, StorageType) {}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@ package writecache
|
||||||
|
|
||||||
func (c *cache) estimateCacheSize() (uint64, uint64) {
|
func (c *cache) estimateCacheSize() (uint64, uint64) {
|
||||||
count, size := c.counter.CountSize()
|
count, size := c.counter.CountSize()
|
||||||
c.metrics.SetEstimateSize(0, size)
|
c.metrics.SetEstimateSize(size)
|
||||||
c.metrics.SetActualCounters(0, count)
|
c.metrics.SetActualCounters(count)
|
||||||
return count, size
|
return count, size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue