Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed May 16, 2024
1 parent dba0c98 commit 57e2d47
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CountItems/CountWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class CountWorker {
if (data.owner !== 'scality') {
return;
}
monitoring.bucketsCount.labels('error').set(0);
monitoring.bucketsCount.labels('success').set(0);
switch (data.type) {
case 'count':
this.countItems(data.bucketInfo, (err, results) => {
Expand Down
9 changes: 0 additions & 9 deletions CountItems/masterProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@ const metricServer = new WebServer(8003, log).onRequest((req, res) => monitoring
));
metricServer.start();

// Set bucketsCount to 0
monitoring.bucketsCount.labels('error').set(0);
monitoring.bucketsCount.labels('success').set(0);

// Set objectsCount to 0
monitoring.objectsCount.labels('error').set(0);
monitoring.objectsCount.labels('success').set(0);
monitoring.objectsCount.labels('skipped').set(0);

const handleSignal = sig => countMaster.stop(sig, () => process.exit(0));
process.on('SIGINT', handleSignal);
process.on('SIGHUP', handleSignal);
Expand Down
5 changes: 5 additions & 0 deletions utils/S3UtilsMongoClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ class S3UtilsMongoClient extends MongoClientInterface {

let startCursorDate = new Date();
let processed = 0;

monitoring.objectsCount.labels('error').set(0);
monitoring.objectsCount.labels('success').set(0);
monitoring.objectsCount.labels('skipped').set(0);

await cursor.forEach(
res => {
// Periodically display information about the cursor
Expand Down

0 comments on commit 57e2d47

Please sign in to comment.