[#563] writecache: Fix metrics and bolt delete

Estimate cache size after delete objects to update metric.
Update counters on small object deletion.
Do not count bbolt DB file as FSTree object.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-08-07 13:31:56 +03:00 committed by Evgenii Stratonikov
parent 5bbfebba2d
commit 0e697266c3
3 changed files with 12 additions and 20 deletions

View file

@ -68,6 +68,9 @@ func (c *cache) initCounters() error {
if err != nil {
return fmt.Errorf("could not read write-cache FS counter: %w", err)
}
if inFS > 0 {
inFS-- //small.bolt DB file
}
c.objCounters.cDB.Store(inDB)
c.objCounters.cFS.Store(inFS)