forked from TrueCloudLab/frostfs-node
[#661] blobovnicza: Compute size with record size
To get more accurate size of blobovnicza use record size (lenght of key + lenght of data). Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
e54dc3dc7c
commit
ad0697adc4
5 changed files with 19 additions and 14 deletions
|
@ -116,10 +116,11 @@ func (b *Blobovnicza) initializeCounters() error {
|
|||
}
|
||||
|
||||
return b.iterateAllDataBuckets(tx, func(lower, upper uint64, b *bbolt.Bucket) (bool, error) {
|
||||
keysN := uint64(b.Stats().KeyN)
|
||||
size += keysN * upper
|
||||
items += keysN
|
||||
return false, nil
|
||||
return false, b.ForEach(func(k, v []byte) error {
|
||||
size += uint64(len(k) + len(v))
|
||||
items++
|
||||
return nil
|
||||
})
|
||||
})
|
||||
})
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue