Skip to content

Commit

Permalink
Prefix every statsd key with the project_name.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémy HUBSCHER committed Mar 31, 2015
1 parent 4615421 commit d07dd9f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This document describes changes between each past release.
-------------------

- AWS driver did not take bucket configuration into account.
- Add a ``loop.`` prefix on not prefixed keys.


0.17.2 (2015-03-31)
Expand Down
6 changes: 3 additions & 3 deletions loop/filestorage/aws.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ AwsDriver.prototype = {
if (err) return callback(err);
if (self.statsdClient !== undefined) {
self.statsdClient.timing(
'aws.write',
'loop.aws.write',
Date.now() - startTime
);
}
Expand Down Expand Up @@ -77,7 +77,7 @@ AwsDriver.prototype = {
var body = data.Body.toString();
if (self.statsdClient !== undefined) {
self.statsdClient.timing(
'aws.read',
'loop.aws.read',
Date.now() - startTime
);
}
Expand All @@ -103,7 +103,7 @@ AwsDriver.prototype = {
if (err && err.code !== "NoSuchKey") return callback(err);
if (self.statsdClient !== undefined) {
self.statsdClient.timing(
'aws.remove',
'loop.aws.remove',
Date.now() - startTime
);
}
Expand Down
6 changes: 3 additions & 3 deletions loop/filestorage/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Filesystem.prototype = {
if (err) return callback(err);
if (self.statsdClient !== undefined) {
self.statsdClient.timing(
'filesystem.write',
'loop.filesystem.write',
Date.now() - startTime
);
}
Expand Down Expand Up @@ -66,7 +66,7 @@ Filesystem.prototype = {
if (err) return callback(err);
if (self.statsdClient !== undefined) {
self.statsdClient.timing(
'filesystem.read',
'loop.filesystem.read',
Date.now() - startTime
);
}
Expand All @@ -90,7 +90,7 @@ Filesystem.prototype = {
if (err && err.code !== "ENOENT") return callback(err);
if (self.statsdClient !== undefined) {
self.statsdClient.timing(
'filesystem.remove',
'loop.filesystem.remove',
Date.now() - startTime
);
}
Expand Down
4 changes: 2 additions & 2 deletions loop/simplepush.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ SimplePush.prototype = {

urls.forEach(function(simplePushUrl) {
if (self.statsdClient !== undefined) {
self.statsdClient.count("simplepush.call", 1);
self.statsdClient.count("simplepush.call." + reason, 1);
self.statsdClient.count("loop.simplepush.call", 1);
self.statsdClient.count("loop.simplepush.call." + reason, 1);
}
request.put({
url: simplePushUrl,
Expand Down
2 changes: 1 addition & 1 deletion loop/tokbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ TokBox.prototype = {
}
if (self.statsdClient !== undefined) {
self.statsdClient.timing(
'tokbox.createSession',
'loop.tokbox.createSession',
Date.now() - startTime
);
}
Expand Down
4 changes: 2 additions & 2 deletions test/simplepush_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ describe("simplePush object", function() {
simplePush.notify("reason", "url1", 12345);

assert.calledTwice(statsdSpy);
assert.calledWithExactly(statsdSpy, "simplepush.call.reason", 1);
assert.calledWithExactly(statsdSpy, "simplepush.call", 1);
assert.calledWithExactly(statsdSpy, "loop.simplepush.call.reason", 1);
assert.calledWithExactly(statsdSpy, "loop.simplepush.call", 1);
});

});

0 comments on commit d07dd9f

Please sign in to comment.