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 963c3ab commit a355a06
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)) {
this.uniqueAccounts.add(resourceName);
monitoring.metricsCount.inc({ metricLevel : metricLevel});
}
if (metricLevel === 'location' && !this.uniqueLocations.has(resourceName)) {
this.uniqueLocations.add(resourceName);
monitoring.metricsCount.inc({ metricLevel : metricLevel});
}
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 a355a06

Please sign in to comment.