frostfs-node/pkg/local_object_storage/engine/metrics.go
Dmitrii Stepanov 4fcc81c999
All checks were successful
ci/woodpecker/pr/pre-commit Pipeline was successful
[#232] shard: Add PUT metrics
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-04-10 15:43:25 +03:00

37 lines
940 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)
AddShardOperationDuration(shardID string, operation string, d time.Duration)
}
func elapsed(addFunc func(d time.Duration)) func() {
t := time.Now()
return func() {
addFunc(time.Since(t))
}
}