diff --git a/CountItems/CountManager.js b/CountItems/CountManager.js index 036a26bc..553bddc1 100644 --- a/CountItems/CountManager.js +++ b/CountItems/CountManager.js @@ -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],