Comparing version 0.0.7 to 0.0.8
@@ -331,3 +331,3 @@ var dgram = require('dgram') | ||
// number matches that sample_rate then stats get returned and the sample | ||
// rate gets appended ("@0.5" in this case). Else we get an empty object. | ||
// rate gets appended ("|@0.5" in this case). Else we get an empty object. | ||
// | ||
@@ -519,3 +519,3 @@ Lynx.prototype.send = function send(stats, sample_rate) { | ||
// number matches that sample_rate then stats get returned and the sample | ||
// rate gets appended ("@0.5" in this case). Else we get an empty object. | ||
// rate gets appended ("|@0.5" in this case). Else we get an empty object. | ||
// | ||
@@ -522,0 +522,0 @@ Lynx.sample = function sample(stats, sample_rate) { |
{ "name" : "lynx" | ||
, "description" : "Minimalistic StatsD client for Node.js programs" | ||
, "version" : "0.0.7" | ||
, "version" : "0.0.8" | ||
, "author" : "Lloyd Hilaiel" | ||
@@ -25,3 +25,3 @@ , "contributors": [ "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)" ] | ||
, "devDependencies": { "tap" : "~0.3.2" } | ||
, "dependencies" : { "mersenne" : "~0.0.3", "statsd-parser": "~0.0.0" } | ||
, "dependencies" : { "mersenne" : "~0.0.3", "statsd-parser": "~0.0.4" } | ||
, "licenses" : | ||
@@ -28,0 +28,0 @@ [ { "type" : "MIT" |
var macros = require('./macros') | ||
, statsd = require('statsd-parser') | ||
, lynx = macros.lynx | ||
@@ -30,2 +31,7 @@ , test = macros.test | ||
// | ||
// Remove console.log from errors, plenty of nothing to send here | ||
// | ||
connection.on_error = function () {}; | ||
// | ||
// We are going to do one thousand `TOTAL` packets | ||
@@ -49,2 +55,10 @@ // and see if we hit our minimums | ||
// | ||
// Add, check if its a valid statsd message and includes sample rate | ||
// that is teh same as being tested | ||
// | ||
var match = statsd.matchStatsd(message.toString()); | ||
t.ok(match, message.toString()); | ||
t.equal(SAMPLE.toString(), match.sample_rate); | ||
// | ||
// When we finally hit our lower threshold | ||
@@ -51,0 +65,0 @@ // |
@@ -20,3 +20,3 @@ var macros = require('./macros'); | ||
// | ||
// Wait 100ms | ||
// Wait 200ms | ||
// | ||
@@ -28,12 +28,2 @@ setTimeout(function () { | ||
timer.stop(); | ||
// | ||
// Atempt to stop already stopped timer | ||
// Will console.log `Can't stop a timer twice` | ||
// | ||
// We are not testing for this, cause its just an error message | ||
// but this would be raised on scenarios where a more strict error handler | ||
// is enforced by the user | ||
// | ||
second_timer.stop(); | ||
}, 200); | ||
@@ -44,2 +34,4 @@ | ||
// | ||
// Wait 100ms | ||
// | ||
var second_timer = connection.createTimer('bar.comes.first'); | ||
@@ -53,2 +45,21 @@ | ||
}, 100); | ||
// | ||
// Attempts to stop the timer again but before `foo.interval` | ||
// If someone breaks the `only stop once code` this will cause an error | ||
// because it will emit before the `foo.interval` and it wont be equal | ||
// | ||
// Wait 150ms | ||
// | ||
setTimeout(function () { | ||
// | ||
// Atempt to stop already stopped timer | ||
// Will console.log `Can't stop a timer twice` | ||
// | ||
// We are not testing for this error, cause its just an error message | ||
// but this would be raised on scenarios where a more strict error handler | ||
// is enforced by the user | ||
// | ||
second_timer.stop(); | ||
}, 150); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39211
1176
Updatedstatsd-parser@~0.0.4