2023-06-02 13:04:02 +00:00
|
|
|
package fstree
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
type Metrics interface {
|
2023-06-07 11:39:03 +00:00
|
|
|
SetParentID(parentID string)
|
|
|
|
|
2023-06-02 13:04:02 +00:00
|
|
|
SetMode(readOnly bool)
|
|
|
|
Close()
|
|
|
|
|
|
|
|
Iterate(d time.Duration, success bool)
|
|
|
|
Delete(d time.Duration, success bool)
|
|
|
|
Exists(d time.Duration, success bool)
|
|
|
|
Put(d time.Duration, size int, success bool)
|
|
|
|
Get(d time.Duration, size int, success bool)
|
|
|
|
GetRange(d time.Duration, size int, success bool)
|
|
|
|
}
|
|
|
|
|
|
|
|
type noopMetrics struct{}
|
|
|
|
|
2023-06-07 11:39:03 +00:00
|
|
|
func (m *noopMetrics) SetParentID(string) {}
|
2023-06-02 13:04:02 +00:00
|
|
|
func (m *noopMetrics) SetMode(bool) {}
|
|
|
|
func (m *noopMetrics) Close() {}
|
|
|
|
func (m *noopMetrics) Iterate(time.Duration, bool) {}
|
|
|
|
func (m *noopMetrics) Delete(time.Duration, bool) {}
|
|
|
|
func (m *noopMetrics) Exists(time.Duration, bool) {}
|
|
|
|
func (m *noopMetrics) Put(time.Duration, int, bool) {}
|
|
|
|
func (m *noopMetrics) Get(time.Duration, int, bool) {}
|
|
|
|
func (m *noopMetrics) GetRange(time.Duration, int, bool) {}
|