forked from TrueCloudLab/frostfs-node
[#915] blobovnicza: Use mean bucket size multiplier instead of min
For fullness estimation of `Blobovnicza` we use number of object stored in each size bucket. In previous implementation we multiplied the number by the difference in bucket boundaries. This expression rather estimated the minimum volume (and for the smallest bucket, the maximum) of objects in the bucket. Multiply number of objects by mean bucket size. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
2920c5203b
commit
90fd883e32
1 changed files with 1 additions and 2 deletions
|
@ -61,7 +61,7 @@ func (b *Blobovnicza) syncFullnessCounter(tx *bbolt.Tx) error {
|
|||
return false, fmt.Errorf("bucket not found %s", stringifyBounds(lower, upper))
|
||||
}
|
||||
|
||||
sz += uint64(buck.Stats().KeyN) * (upper - lower)
|
||||
sz += uint64(buck.Stats().KeyN) * (upper + lower) / 2
|
||||
|
||||
return false, nil
|
||||
}); err != nil {
|
||||
|
@ -71,5 +71,4 @@ func (b *Blobovnicza) syncFullnessCounter(tx *bbolt.Tx) error {
|
|||
b.filled.Store(sz)
|
||||
|
||||
return nil
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue