[#312] metrics: Add writecache metrcis

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-05-19 11:17:19 +03:00 committed by Evgenii Stratonikov
parent d212d908b5
commit 2ce43935f9
14 changed files with 415 additions and 32 deletions

View file

@ -11,7 +11,7 @@ import (
func (c *cache) estimateCacheSize() uint64 {
db := c.objCounters.DB() * c.smallObjectSize
fstree := c.objCounters.FS() * c.maxObjectSize
c.metrics.Estimate(db, fstree)
c.metrics.SetEstimateSize(db, fstree)
return db + fstree
}
@ -71,6 +71,7 @@ func (c *cache) initCounters() error {
c.objCounters.cDB.Store(inDB)
c.objCounters.cFS.Store(inFS)
c.metrics.SetActualCounters(inDB, inFS)
return nil
}