Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

process-reporter

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

process-reporter - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

16

index.js

@@ -102,2 +102,5 @@ 'use strict';

this.cachedMemoryUsage = null;
this.cachedLagTime = null;
this._setupClosure();

@@ -222,2 +225,7 @@ }

ProcessReporter.prototype.getCachedMemoryUsage =
function getCachedMemoryUsage() {
return this.cachedMemoryUsage;
};
ProcessReporter.prototype._reportMemory = function _reportMemory() {

@@ -236,2 +244,4 @@ var self = this;

self.statsd.gauge(memPrefix + '.heap-total', usage.heapTotal);
self.cachedMemoryUsage = usage;
};

@@ -249,2 +259,6 @@

ProcessReporter.prototype.getCachedLagTime = function getCachedLagTime() {
return this.cachedLagTime;
};
ProcessReporter.prototype._reportLag = function _reportLag() {

@@ -265,2 +279,4 @@ var self = this;

}
self.cachedLagTime = lagTime;
};

@@ -267,0 +283,0 @@

2

package.json
{
"name": "process-reporter",
"version": "2.4.0",
"version": "2.5.0",
"description": "process reporter",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -72,2 +72,24 @@ 'use strict';

test('processReporter caches memory usage and lag time', function t(assert) {
var workerStatsd = createFakeStatsd();
var clusterStatsd = createFakeStatsd();
var reporter = processReporter({
statsd: workerStatsd,
clusterStatsd: clusterStatsd,
lagInterval: 10,
memoryInterval: 10
});
reporter.bootstrap();
setTimeout(onReported, 15);
function onReported() {
assert.notEqual(reporter.getCachedLagTime(), null);
assert.notEqual(reporter.getCachedMemoryUsage(), null);
reporter.destroy();
assert.end();
}
});
test('processReporter prefix', function t(assert) {

@@ -74,0 +96,0 @@ var fakeStatsd = {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc