[#1596] metrics: Create public aliases for internal engine
metrics
All checks were successful
Vulncheck / Vulncheck (push) Successful in 58s
Pre-commit hooks / Pre-commit (push) Successful in 1m21s
Build / Build Components (push) Successful in 1m33s
Tests and linters / gopls check (push) Successful in 2m14s
Tests and linters / Run gofumpt (push) Successful in 2m55s
Tests and linters / Tests (push) Successful in 2m59s
Tests and linters / Staticcheck (push) Successful in 3m7s
Tests and linters / Lint (push) Successful in 3m15s
Tests and linters / Tests with -race (push) Successful in 3m44s
All checks were successful
Vulncheck / Vulncheck (push) Successful in 58s
Pre-commit hooks / Pre-commit (push) Successful in 1m21s
Build / Build Components (push) Successful in 1m33s
Tests and linters / gopls check (push) Successful in 2m14s
Tests and linters / Run gofumpt (push) Successful in 2m55s
Tests and linters / Tests (push) Successful in 2m59s
Tests and linters / Staticcheck (push) Successful in 3m7s
Tests and linters / Lint (push) Successful in 3m15s
Tests and linters / Tests with -race (push) Successful in 3m44s
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
a2485637bb
commit
6c51f48aab
1 changed files with 11 additions and 33 deletions
|
@ -7,34 +7,12 @@ import (
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MetricRegister interface {
|
type (
|
||||||
AddMethodDuration(method string, d time.Duration)
|
MetricRegister = metrics.EngineMetrics
|
||||||
|
GCMetrics = metrics.GCMetrics
|
||||||
SetObjectCounter(shardID, objectType string, v uint64)
|
WriteCacheMetrics = metrics.WriteCacheMetrics
|
||||||
AddToObjectCounter(shardID, objectType string, delta int)
|
NullBool = metrics.NullBool
|
||||||
|
)
|
||||||
SetMode(shardID string, mode mode.Mode)
|
|
||||||
|
|
||||||
AddToContainerSize(cnrID string, size int64)
|
|
||||||
DeleteContainerSize(cnrID string)
|
|
||||||
DeleteContainerCount(cnrID string)
|
|
||||||
AddToPayloadCounter(shardID string, size int64)
|
|
||||||
IncErrorCounter(shardID string)
|
|
||||||
ClearErrorCounter(shardID string)
|
|
||||||
DeleteShardMetrics(shardID string)
|
|
||||||
|
|
||||||
SetContainerObjectCounter(shardID, contID, objectType string, v uint64)
|
|
||||||
IncContainerObjectCounter(shardID, contID, objectType string)
|
|
||||||
SubContainerObjectCounter(shardID, contID, objectType string, v uint64)
|
|
||||||
|
|
||||||
IncRefillObjectsCount(shardID, path string, size int, success bool)
|
|
||||||
SetRefillPercent(shardID, path string, percent uint32)
|
|
||||||
SetRefillStatus(shardID, path, status string)
|
|
||||||
SetEvacuationInProgress(shardID string, value bool)
|
|
||||||
|
|
||||||
WriteCache() metrics.WriteCacheMetrics
|
|
||||||
GC() metrics.GCMetrics
|
|
||||||
}
|
|
||||||
|
|
||||||
func elapsed(method string, addFunc func(method string, d time.Duration)) func() {
|
func elapsed(method string, addFunc func(method string, d time.Duration)) func() {
|
||||||
t := time.Now()
|
t := time.Now()
|
||||||
|
@ -76,9 +54,9 @@ type (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
_ MetricRegister = noopMetrics{}
|
_ MetricRegister = noopMetrics{}
|
||||||
_ metrics.WriteCacheMetrics = noopWriteCacheMetrics{}
|
_ WriteCacheMetrics = noopWriteCacheMetrics{}
|
||||||
_ metrics.GCMetrics = noopGCMetrics{}
|
_ GCMetrics = noopGCMetrics{}
|
||||||
)
|
)
|
||||||
|
|
||||||
func (noopMetrics) AddMethodDuration(string, time.Duration) {}
|
func (noopMetrics) AddMethodDuration(string, time.Duration) {}
|
||||||
|
@ -99,8 +77,8 @@ func (noopMetrics) IncRefillObjectsCount(string, string, int, bool) {}
|
||||||
func (noopMetrics) SetRefillPercent(string, string, uint32) {}
|
func (noopMetrics) SetRefillPercent(string, string, uint32) {}
|
||||||
func (noopMetrics) SetRefillStatus(string, string, string) {}
|
func (noopMetrics) SetRefillStatus(string, string, string) {}
|
||||||
func (noopMetrics) SetEvacuationInProgress(string, bool) {}
|
func (noopMetrics) SetEvacuationInProgress(string, bool) {}
|
||||||
func (noopMetrics) WriteCache() metrics.WriteCacheMetrics { return noopWriteCacheMetrics{} }
|
func (noopMetrics) WriteCache() WriteCacheMetrics { return noopWriteCacheMetrics{} }
|
||||||
func (noopMetrics) GC() metrics.GCMetrics { return noopGCMetrics{} }
|
func (noopMetrics) GC() GCMetrics { return noopGCMetrics{} }
|
||||||
|
|
||||||
func (noopWriteCacheMetrics) AddMethodDuration(string, string, string, string, bool, time.Duration) {}
|
func (noopWriteCacheMetrics) AddMethodDuration(string, string, string, string, bool, time.Duration) {}
|
||||||
func (noopWriteCacheMetrics) SetActualCount(string, string, string, uint64) {}
|
func (noopWriteCacheMetrics) SetActualCount(string, string, string, uint64) {}
|
||||||
|
|
Loading…
Reference in a new issue