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
|
@ -22,6 +22,8 @@ type Option func(*cfg)
|
|||
|
||||
type cfg struct {
|
||||
log *logger.Logger
|
||||
|
||||
enableMetrics bool
|
||||
}
|
||||
|
||||
func defaultCfg() *cfg {
|
||||
|
@ -51,3 +53,9 @@ func WithLogger(l *logger.Logger) Option {
|
|||
c.log = l
|
||||
}
|
||||
}
|
||||
|
||||
func WithMetrics(v bool) Option {
|
||||
return func(c *cfg) {
|
||||
c.enableMetrics = v
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue