forked from TrueCloudLab/frostfs-node
[#1121] node: Change mode of shard components
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
parent
6f2187a420
commit
806236da78
47 changed files with 194 additions and 100 deletions
|
@ -4,12 +4,13 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-observability/metrics"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
type FSTreeMetrics interface {
|
||||
SetMode(shardID, path string, readOnly bool)
|
||||
SetMode(shardID, path string, mode mode.ComponentMode)
|
||||
Close(shardID, path string)
|
||||
|
||||
MethodDuration(shardID, path string, method string, d time.Duration, success bool)
|
||||
|
@ -48,8 +49,8 @@ func newFSTreeMetrics() *fstreeMetrics {
|
|||
}
|
||||
}
|
||||
|
||||
func (m *fstreeMetrics) SetMode(shardID, path string, readOnly bool) {
|
||||
m.mode.SetMode(shardID, path, modeFromBool(readOnly))
|
||||
func (m *fstreeMetrics) SetMode(shardID, path string, mod mode.ComponentMode) {
|
||||
m.mode.SetMode(shardID, path, mod.String())
|
||||
}
|
||||
|
||||
func (m *fstreeMetrics) Close(shardID, path string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue