Skip to content

Commit

Permalink
Ensure consistency of metrics names
Browse files Browse the repository at this point in the history
Also remove unused callback in the mongodb foreach

Issue: S3UTILS-186
  • Loading branch information
williamlardier committed Dec 26, 2024
1 parent 8ab689d commit 27e388f
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 145 deletions.
6 changes: 3 additions & 3 deletions CountItems/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function consolidateDataMetrics(target, source) {
_currentRestoring: 0,
_nonCurrentRestored: 0,
_nonCurrentRestoring: 0,
_incompleteMPUParts: 0,
_incompleteMPUUploads: 0,
deleteMarker: 0,
},
});
Expand Down Expand Up @@ -61,7 +61,7 @@ function consolidateDataMetrics(target, source) {
resTarget.objectCount._currentRestored += objectCount && objectCount._currentRestored ? objectCount._currentRestored : 0;
resTarget.objectCount._nonCurrentRestoring += objectCount && objectCount._nonCurrentRestoring ? objectCount._nonCurrentRestoring : 0;
resTarget.objectCount._nonCurrentRestored += objectCount && objectCount._nonCurrentRestored ? objectCount._nonCurrentRestored : 0;
resTarget.objectCount._incompleteMPUParts += objectCount && objectCount._incompleteMPUParts ? objectCount._incompleteMPUParts : 0;
resTarget.objectCount._incompleteMPUUploads += objectCount && objectCount._incompleteMPUUploads ? objectCount._incompleteMPUUploads : 0;

resTarget.usedCapacity._inflightsPreScan += usedCapacity && usedCapacity._inflightsPreScan ? usedCapacity._inflightsPreScan : 0;
if (accountOwnerID) {
Expand All @@ -75,7 +75,7 @@ function consolidateDataMetrics(target, source) {
? usedCapacity._nonCurrentCold + usedCapacity._nonCurrentRestored + usedCapacity._nonCurrentRestoring : 0;
resTarget.objectCount.current += objectCount
? objectCount._currentCold + objectCount._currentRestored + objectCount._currentRestoring
+ objectCount._incompleteMPUParts : 0;
+ objectCount._incompleteMPUUploads : 0;
resTarget.objectCount.nonCurrent += objectCount
? objectCount._nonCurrentCold + objectCount._nonCurrentRestored + objectCount._nonCurrentRestoring : 0;

Expand Down
Loading

0 comments on commit 27e388f

Please sign in to comment.