[#426] engine: Support duration metrics

With `enable metrics` option, engine will collect
durations for all public methods.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-03-15 16:09:27 +03:00 committed by Leonard Lyubich
parent bc6e7a823b
commit 980b774af2
12 changed files with 169 additions and 0 deletions

View file

@ -27,6 +27,10 @@ func (p *DeletePrm) WithAddresses(addr ...*objectSDK.Address) *DeletePrm {
// Delete marks the objects to be removed.
func (e *StorageEngine) Delete(prm *DeletePrm) (*DeleteRes, error) {
if e.enableMetrics {
defer elapsed(deleteDuration)()
}
shPrm := new(shard.InhumePrm)
existsPrm := new(shard.ExistsPrm)