frostfs-node/pkg/local_object_storage/engine/metrics.go
Alex Vanin b8e10571c6 [] Put prometheus behind pkg/metrics
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-17 10:58:00 +03:00

27 lines
604 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)
}
func elapsed(addFunc func(d time.Duration)) func() {
t := time.Now()
return func() {
addFunc(time.Since(t))
}
}