-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed illegal character problem #11
Fixed illegal character problem #11
Conversation
|
@SebastianIoanPop Shouldn't there be tests for this functionality btw? |
index.js
Outdated
@@ -2,6 +2,9 @@ | |||
let defaultInterval = 10; | |||
let oneSecInMs = 1000; | |||
let keyCountAppendName = 'keyCounter'; | |||
let statsdIllegalCharacter = ':'; | |||
let defaultWordSeparatorCharacter = '-'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to use a const for that
index.js
Outdated
@@ -50,7 +53,9 @@ redisClients.forEach((c) => { | |||
return; | |||
} | |||
|
|||
statsdClient.gauge(`${prefix}${stat.key}${suffix}`, stat.count); | |||
var cleanKey = stat.key.replace(statsdIllegalCharacter, defaultWordSeparatorCharacter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var declaration should be at the top of the code block + use let
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments
index.js
Outdated
|
||
if (err) { | ||
util.log(`[${c.host}] ${err}`); | ||
return; | ||
} | ||
|
||
statsdClient.gauge(`${prefix}${stat.key}${suffix}`, stat.count); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove spaces/tab
No description provided.