Some checks failed
DCO action / DCO (pull_request) Successful in 41s
Vulncheck / Vulncheck (pull_request) Successful in 51s
Tests and linters / Run gofumpt (pull_request) Successful in 1m6s
Build / Build Components (pull_request) Successful in 1m25s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m25s
Tests and linters / Lint (pull_request) Failing after 1m45s
Tests and linters / Tests (pull_request) Successful in 2m8s
Tests and linters / Staticcheck (pull_request) Successful in 2m8s
Tests and linters / gopls check (pull_request) Successful in 2m48s
Tests and linters / Tests with -race (pull_request) Successful in 3m11s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
37 lines
898 B
Go
37 lines
898 B
Go
package metrics
|
|
|
|
import (
|
|
"time"
|
|
|
|
metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics"
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/pilorama"
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
|
|
)
|
|
|
|
func NewPiloramaMetrics(m metrics_impl.PiloramaMetrics) pilorama.Metrics {
|
|
return &piloramaMetrics{
|
|
shardID: undefined,
|
|
m: m,
|
|
}
|
|
}
|
|
|
|
type piloramaMetrics struct {
|
|
shardID string
|
|
m metrics_impl.PiloramaMetrics
|
|
}
|
|
|
|
func (m *piloramaMetrics) SetParentID(id string) {
|
|
m.shardID = id
|
|
}
|
|
|
|
func (m *piloramaMetrics) SetMode(mod mode.ComponentMode) {
|
|
m.m.SetMode(m.shardID, mod)
|
|
}
|
|
|
|
func (m *piloramaMetrics) Close() {
|
|
m.m.Close(m.shardID)
|
|
}
|
|
|
|
func (m *piloramaMetrics) AddMethodDuration(method string, d time.Duration, success bool, ioTag string) {
|
|
m.m.AddMethodDuration(m.shardID, method, d, success, ioTag)
|
|
}
|