Add increasing case for the payload size metric #46

Merged
ir0nbee merged 1 commit from fix/payload_size_metric_does_not_increase into master 2023-02-09 10:30:24 +00:00
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)
}