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 a355a06 commit f87041e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions CountItems/CountManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,22 @@ class CountManager {
&& results.dataMetrics.location
&& results.dataMetrics.account) {
Object.keys(results.dataMetrics).forEach(metricLevel => {
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 => {
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);
// resourceName can be the name of bucket, location or account
this.dataMetrics[metricLevel][resourceName] = consolidateDataMetrics(
this.dataMetrics[metricLevel][resourceName],
Expand Down

0 comments on commit f87041e

Please sign in to comment.