process-reporter
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -90,3 +90,3 @@ 'use strict'; | ||
self.requestTimer = | ||
self.timers.setTimeout(onHandle, self.handleInterval); | ||
self.timers.setTimeout(onRequest, self.requestInterval); | ||
} | ||
@@ -93,0 +93,0 @@ |
{ | ||
"name": "process-reporter", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "process reporter", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
49
test.js
@@ -55,1 +55,50 @@ 'use strict'; | ||
}); | ||
test('processReporter prefix', function t(assert) { | ||
var fakeStatsd = { | ||
records: [], | ||
timing: function timing(key, value) { | ||
this.records.push({ | ||
key: key, | ||
value: value, | ||
type: 'timing' | ||
}); | ||
}, | ||
gauge: function gauge(key, value) { | ||
this.records.push({ | ||
key: key, | ||
value: value, | ||
type: 'gauge' | ||
}); | ||
} | ||
}; | ||
var reporter = processReporter({ | ||
handleInterval: 10, | ||
requestInterval: 10, | ||
statsd: fakeStatsd, | ||
prefix: 'foobarbaz' | ||
}); | ||
reporter.bootstrap(); | ||
setTimeout(onReported, 15); | ||
function onReported() { | ||
reporter.destroy(); | ||
var records = fakeStatsd.records; | ||
var handles = records[0]; | ||
var requests = records[1]; | ||
assert.equal(records.length, 2); | ||
assert.equal(handles.key, 'foobarbaz.process-reporter.handles'); | ||
assert.equal(requests.key, 'foobarbaz.process-reporter.requests'); | ||
assert.equal(typeof handles.value, 'number'); | ||
assert.equal(typeof requests.value, 'number'); | ||
reporter.destroy(); | ||
assert.end(); | ||
} | ||
}); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
9766
199
0