forked from TrueCloudLab/frostfs-node
[#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
|
@ -38,6 +38,10 @@ func (p *ExistsRes) Exists() bool {
|
|||
// Returns any error encountered that does not allow to
|
||||
// unambiguously determine the presence of an object.
|
||||
func (e *StorageEngine) Exists(prm *ExistsPrm) (*ExistsRes, error) {
|
||||
if e.enableMetrics {
|
||||
defer elapsed(existsDuration)()
|
||||
}
|
||||
|
||||
exists, err := e.exists(prm.addr)
|
||||
|
||||
return &ExistsRes{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue