[#426] Put prometheus behind pkg/metrics

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-03-16 11:14:56 +03:00 committed by Leonard Lyubich
parent 3c0e47e6fd
commit b8e10571c6
19 changed files with 561 additions and 311 deletions

View file

@ -56,8 +56,8 @@ func (r *HeadRes) Header() *object.Object {
// Returns object.ErrNotFound if requested object is missing in local storage.
// Returns object.ErrAlreadyRemoved if requested object was inhumed.
func (e *StorageEngine) Head(prm *HeadPrm) (*HeadRes, error) {
if e.enableMetrics {
defer elapsed(headDuration)()
if e.metrics != nil {
defer elapsed(e.metrics.AddHeadDuration)()
}
var (