Skip to content

Commit

Permalink
S3UTILS-158: objectCounts metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed May 13, 2024
1 parent b5e8a19 commit 1f0e50a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/S3UtilsMongoClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const { errors, constants } = require('arsenal');
const async = require('async');
const { validStorageMetricLevels } = require('../CountItems/utils/constants');
const getLocationConfig = require('./locationConfig');
const monitoring = require('./monitoring');

const METASTORE = '__metastore';
const INFOSTORE = '__infostore';
Expand Down Expand Up @@ -150,6 +151,7 @@ class S3UtilsMongoClient extends MongoClientInterface {
entry: res,
error,
});
monitoring.objectsCount.inc({ state: 'error' });
return;
}

Expand All @@ -159,6 +161,7 @@ class S3UtilsMongoClient extends MongoClientInterface {
method: 'getObjectMDStats',
entry: res,
});
monitoring.objectsCount.inc({ state: 'skipped' });
return;
}

Expand Down Expand Up @@ -231,6 +234,7 @@ class S3UtilsMongoClient extends MongoClientInterface {
collRes.account[account].locations[location].deleteMarkerCount += res.value.isDeleteMarker ? 1 : 0;
});
});
monitoring.objectsCount.inc({ state: 'success' });
processed++;
},
err => {
Expand Down

0 comments on commit 1f0e50a

Please sign in to comment.