[#933] write-cache: Use real number of objects in counters
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
29955a3036
commit
616013cb8a
1 changed files with 6 additions and 3 deletions
|
@ -91,9 +91,12 @@ func (x *counters) Read() error {
|
|||
|
||||
x.cDB.Store(inDB)
|
||||
|
||||
// FIXME: calculate the actual value in FSTree (new method?).
|
||||
// For now we can think that db/fs = 50/50.
|
||||
x.cFS.Store(inDB)
|
||||
inFS, err := x.fs.NumberOfObjects()
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not read write-cache FS counter: %w", err)
|
||||
}
|
||||
|
||||
x.cFS.Store(inFS)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue