[#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:
parent
bc6e7a823b
commit
980b774af2
12 changed files with 169 additions and 0 deletions
|
@ -56,6 +56,10 @@ 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)()
|
||||
}
|
||||
|
||||
var (
|
||||
head *object.Object
|
||||
siErr *objectSDK.SplitInfoError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue