[#1794] metrics: Track physical object capacity per shard

Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
Pavel Karpy 2023-01-25 17:01:25 +03:00 committed by fyrchik
parent 9513f163aa
commit 89a0266f5e
7 changed files with 60 additions and 3 deletions

View file

@ -78,11 +78,16 @@ func (s *Shard) delete(prm DeletePrm) (DeleteRes, error) {
return DeleteRes{}, err // stop on metabase error ?
}
var totalRemovedPayload uint64
s.decObjectCounterBy(physical, res.RawObjectsRemoved())
s.decObjectCounterBy(logical, res.AvailableObjectsRemoved())
for i := range prm.addr {
s.addToContainerSize(prm.addr[i].Container().EncodeToString(), -int64(res.RemovedObjectSizes()[i]))
removedPayload := res.RemovedObjectSizes()[i]
totalRemovedPayload += removedPayload
s.addToContainerSize(prm.addr[i].Container().EncodeToString(), -int64(removedPayload))
}
s.addToPayloadCounter(-int64(totalRemovedPayload))
for i := range prm.addr {
var delPrm common.DeletePrm