[#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

@ -48,8 +48,8 @@ func (r *SelectRes) AddressList() []*object.Address {
//
// Returns any error encountered that did not allow to completely select the objects.
func (e *StorageEngine) Select(prm *SelectPrm) (*SelectRes, error) {
if e.enableMetrics {
defer elapsed(searchDuration)()
if e.metrics != nil {
defer elapsed(e.metrics.AddSearchDuration)()
}
addrList := make([]*object.Address, 0)
@ -98,8 +98,8 @@ func (e *StorageEngine) Select(prm *SelectPrm) (*SelectRes, error) {
// List returns `limit` available physically storage object addresses in engine.
// If limit is zero, then returns all available object addresses.
func (e *StorageEngine) List(limit uint64) (*SelectRes, error) {
if e.enableMetrics {
defer elapsed(listObjectsDuration)()
if e.metrics != nil {
defer elapsed(e.metrics.AddListObjectsDuration)()
}
addrList := make([]*object.Address, limit)