Skip to content

Commit

Permalink
result logging
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed May 13, 2024
1 parent 9618649 commit 6ca0e03
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions CountItems/CountManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class CountManager {
account: {},
};
this.workerList = [];
this.uniqueAccounts = new Set();
this.uniqueLocations = new Set();
this.uniqueBuckets = new Set();
this._setupQueue();
}

Expand Down Expand Up @@ -90,9 +93,19 @@ class CountManager {
&& results.dataMetrics.location
&& results.dataMetrics.account) {
Object.keys(results.dataMetrics).forEach(metricLevel => {
monitoring.metricsCount.inc({ metricLevel : metricLevel});
console.log(`dataMetrics: ${JSON.stringify(results.dataMetrics)}`);
console.log(`metrics results: ${JSON.stringify(results)}`);
if (metricLevel === 'account' && !this.uniqueAccounts.has(resourceName)) {

Check failure on line 96 in CountItems/CountManager.js

View workflow job for this annotation

GitHub Actions / tests

'resourceName' is not defined
this.uniqueAccounts.add(resourceName);

Check failure on line 97 in CountItems/CountManager.js

View workflow job for this annotation

GitHub Actions / tests

'resourceName' is not defined
monitoring.metricsCount.inc({ metricLevel : metricLevel});

Check failure on line 98 in CountItems/CountManager.js

View workflow job for this annotation

GitHub Actions / tests

Expected property shorthand

Check failure on line 98 in CountItems/CountManager.js

View workflow job for this annotation

GitHub Actions / tests

Extra space after key 'metricLevel'

Check failure on line 98 in CountItems/CountManager.js

View workflow job for this annotation

GitHub Actions / tests

A space is required before '}'
}
if (metricLevel === 'location' && !this.uniqueLocations.has(resourceName)) {

Check failure on line 100 in CountItems/CountManager.js

View workflow job for this annotation

GitHub Actions / tests

'resourceName' is not defined
this.uniqueLocations.add(resourceName);

Check failure on line 101 in CountItems/CountManager.js

View workflow job for this annotation

GitHub Actions / tests

'resourceName' is not defined
monitoring.metricsCount.inc({ metricLevel : metricLevel});

Check failure on line 102 in CountItems/CountManager.js

View workflow job for this annotation

GitHub Actions / tests

Expected property shorthand

Check failure on line 102 in CountItems/CountManager.js

View workflow job for this annotation

GitHub Actions / tests

Extra space after key 'metricLevel'

Check failure on line 102 in CountItems/CountManager.js

View workflow job for this annotation

GitHub Actions / tests

A space is required before '}'
}
if (metricLevel === 'bucket' && !this.uniqueBuckets.has(resourceName)) {
this.uniqueBuckets.add(resourceName);
monitoring.metricsCount.inc({ metricLevel : metricLevel});
}
console.log(monitoring.metricsCount);
// metricLevel can only be 'bucket', 'location' or 'account'
if (validStorageMetricLevels.has(metricLevel)) {
Object.keys(results.dataMetrics[metricLevel]).forEach(resourceName => {
Expand Down

0 comments on commit 6ca0e03

Please sign in to comment.