frostfs-node/pkg/local_object_storage/engine/metrics.go
Pavel Karpy 89a0266f5e [#1794] metrics: Track physical object capacity per shard
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
2023-01-26 20:06:28 +03:00

35 lines
861 B
Go

package engine
import (
"time"
)
type MetricRegister interface {
AddListContainersDuration(d time.Duration)
AddEstimateContainerSizeDuration(d time.Duration)
AddDeleteDuration(d time.Duration)
AddExistsDuration(d time.Duration)
AddGetDuration(d time.Duration)
AddHeadDuration(d time.Duration)
AddInhumeDuration(d time.Duration)
AddPutDuration(d time.Duration)
AddRangeDuration(d time.Duration)
AddSearchDuration(d time.Duration)
AddListObjectsDuration(d time.Duration)
SetObjectCounter(shardID, objectType string, v uint64)
AddToObjectCounter(shardID, objectType string, delta int)
SetReadonly(shardID string, readonly bool)
AddToContainerSize(cnrID string, size int64)
AddToPayloadCounter(shardID string, size int64)
}
func elapsed(addFunc func(d time.Duration)) func() {
t := time.Now()
return func() {
addFunc(time.Since(t))
}
}