2023-06-09 13:19:47 +00:00
|
|
|
package metrics
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/pilorama"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
|
|
|
|
metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics"
|
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2024-06-04 13:28:47 +00:00
|
|
|
func (m *piloramaMetrics) SetMode(mod mode.ComponentMode) {
|
|
|
|
m.m.SetMode(m.shardID, mod)
|
2023-06-09 13:19:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *piloramaMetrics) Close() {
|
|
|
|
m.m.Close(m.shardID)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *piloramaMetrics) AddMethodDuration(method string, d time.Duration, success bool) {
|
|
|
|
m.m.AddMethodDuration(m.shardID, method, d, success)
|
|
|
|
}
|