2023-06-05 07:25:25 +00:00
|
|
|
package blobovniczatree
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobovnicza"
|
2024-06-04 13:28:47 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
|
2023-06-05 07:25:25 +00:00
|
|
|
)
|
|
|
|
|
2023-09-27 15:21:37 +00:00
|
|
|
const (
|
|
|
|
rebuildStatusNotStarted = "not_started"
|
|
|
|
rebuildStatusRunning = "running"
|
|
|
|
rebuildStatusCompleted = "completed"
|
|
|
|
rebuildStatusFailed = "failed"
|
|
|
|
)
|
|
|
|
|
2023-06-05 07:25:25 +00:00
|
|
|
type Metrics interface {
|
2023-08-18 08:14:10 +00:00
|
|
|
Blobovnicza() blobovnicza.Metrics
|
2023-06-05 07:25:25 +00:00
|
|
|
|
2023-06-07 11:39:03 +00:00
|
|
|
SetParentID(parentID string)
|
|
|
|
|
2024-06-04 13:28:47 +00:00
|
|
|
SetMode(mode.ComponentMode)
|
2023-06-05 07:25:25 +00:00
|
|
|
Close()
|
|
|
|
|
2023-09-27 15:21:37 +00:00
|
|
|
SetRebuildStatus(status string)
|
|
|
|
ObjectMoved(d time.Duration)
|
2023-10-11 06:23:55 +00:00
|
|
|
SetRebuildPercent(value uint32)
|
2024-03-12 14:36:26 +00:00
|
|
|
ObjectsCount(d time.Duration, success bool)
|
2023-09-27 15:21:37 +00:00
|
|
|
|
2023-06-05 07:25:25 +00:00
|
|
|
Delete(d time.Duration, success, withStorageID bool)
|
|
|
|
Exists(d time.Duration, success, withStorageID bool)
|
|
|
|
GetRange(d time.Duration, size int, success, withStorageID bool)
|
|
|
|
Get(d time.Duration, size int, success, withStorageID bool)
|
|
|
|
Iterate(d time.Duration, success bool)
|
|
|
|
Put(d time.Duration, size int, success bool)
|
|
|
|
}
|
|
|
|
|
|
|
|
type noopMetrics struct{}
|
|
|
|
|
2023-06-07 11:39:03 +00:00
|
|
|
func (m *noopMetrics) SetParentID(string) {}
|
2024-06-04 13:28:47 +00:00
|
|
|
func (m *noopMetrics) SetMode(mode.ComponentMode) {}
|
2023-06-05 07:25:25 +00:00
|
|
|
func (m *noopMetrics) Close() {}
|
2023-09-27 15:21:37 +00:00
|
|
|
func (m *noopMetrics) SetRebuildStatus(string) {}
|
2023-10-11 06:23:55 +00:00
|
|
|
func (m *noopMetrics) SetRebuildPercent(uint32) {}
|
2023-09-27 15:21:37 +00:00
|
|
|
func (m *noopMetrics) ObjectMoved(time.Duration) {}
|
2023-06-05 07:25:25 +00:00
|
|
|
func (m *noopMetrics) Delete(time.Duration, bool, bool) {}
|
|
|
|
func (m *noopMetrics) Exists(time.Duration, bool, bool) {}
|
|
|
|
func (m *noopMetrics) GetRange(time.Duration, int, bool, bool) {}
|
|
|
|
func (m *noopMetrics) Get(time.Duration, int, bool, bool) {}
|
|
|
|
func (m *noopMetrics) Iterate(time.Duration, bool) {}
|
|
|
|
func (m *noopMetrics) Put(time.Duration, int, bool) {}
|
2024-03-12 14:36:26 +00:00
|
|
|
func (m *noopMetrics) ObjectsCount(time.Duration, bool) {}
|
2023-08-18 08:14:10 +00:00
|
|
|
func (m *noopMetrics) Blobovnicza() blobovnicza.Metrics {
|
2023-06-09 09:14:32 +00:00
|
|
|
return &blobovnicza.NoopMetrics{}
|
|
|
|
}
|