[#373] blobstor: Add metrics

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-06-06 09:05:52 +03:00
parent 8318d90ad0
commit f54cc0b607
11 changed files with 134 additions and 19 deletions

View file

@ -43,10 +43,12 @@ type cfg struct {
compression compression.Config
log *logger.Logger
storage []SubStorage
metrics Metrics
}
func initConfig(c *cfg) {
c.log = &logger.Logger{Logger: zap.L()}
c.metrics = &noopMetrics{}
}
// New creates, initializes and returns new BlobStor instance.
@ -113,3 +115,9 @@ func (b *BlobStor) SetReportErrorFunc(f func(string, error)) {
b.storage[i].Storage.SetReportErrorFunc(f)
}
}
func WithMetrics(m Metrics) Option {
return func(c *cfg) {
c.metrics = m
}
}