[#1794] shard: Add increasing case for the payload size metric

Signed-off-by: Artem Tataurov <a.tataurov@yadro.com>
This commit is contained in:
Artem Tataurov 2023-02-07 14:28:28 +03:00 committed by fyrchik
parent 5ffa826897
commit ab21d90cfb
4 changed files with 4 additions and 2 deletions

View file

@ -15,6 +15,7 @@ Changelog for FrostFS Node
- Env prefix in configuration changed to `FROSTFS_*` (#43)
### Fixed
- Increase payload size metric on shards' `put` operation (#1794)
- Big object removal with non-local parts (#1978)
- Disable pilorama when moving to degraded mode (#2197)
- Fetching blobovnicza objects that not found in write-cache (#2206)

View file

@ -87,7 +87,7 @@ func (s *Shard) delete(prm DeletePrm) (DeleteRes, error) {
totalRemovedPayload += removedPayload
s.addToContainerSize(prm.addr[i].Container().EncodeToString(), -int64(removedPayload))
}
s.addToPayloadCounter(-int64(totalRemovedPayload))
s.addToPayloadSize(-int64(totalRemovedPayload))
for i := range prm.addr {
var delPrm common.DeletePrm

View file

@ -79,6 +79,7 @@ func (s *Shard) Put(prm PutPrm) (PutRes, error) {
}
s.incObjectCounter()
s.addToPayloadSize(int64(prm.obj.PayloadSize()))
s.addToContainerSize(putPrm.Address.Container().EncodeToString(), int64(prm.obj.PayloadSize()))
}

View file

@ -388,7 +388,7 @@ func (s *Shard) addToContainerSize(cnr string, size int64) {
}
}
func (s *Shard) addToPayloadCounter(size int64) {
func (s *Shard) addToPayloadSize(size int64) {
if s.cfg.metricsWriter != nil {
s.cfg.metricsWriter.AddToPayloadSize(size)
}