Skip to content

Commit

Permalink
allow substrings for blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashant Nayak committed Sep 17, 2016
1 parent c6e74fa commit 6fefc86
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/aws-cloudwatch-statsd-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ CloudwatchBackend.prototype.processKey = function(key) {

CloudwatchBackend.prototype.isBlacklisted = function(key) {

if (this.config.blacklist && this.config.blacklist.length > 0 && this.config.blacklist.indexOf(key) !== -1) {
// console.log("Key (counter) " + key + " is blacklisted");
return true;
var blacklisted = false;
if (this.config.blacklist && this.config.blacklist.length > 0) {
for (var i = 0; i < this.config.blacklist.length; i++) {
if (key.indexOf(this.config.blacklist[i]) >= 0) {
blacklisted = true;
break;
}
}
}

return false;
return blacklisted;
};

CloudwatchBackend.prototype.chunk = function(arr, chunkSize) {
Expand Down

0 comments on commit 6fefc86

Please sign in to comment.