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

process-reporter

Package Overview
Dependencies
Maintainers
2
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 1.1.3 to 2.0.0

48

index.js

@@ -6,2 +6,3 @@ 'use strict';

var assert = require('assert');
var _gcstats;
var _toobusy;

@@ -71,2 +72,8 @@

self.lagTimer = null;
self.gcStats = null;
self._onStatsListener = onStats;
function onStats(gcInfo) {
self._reportGCStats(gcInfo);
}
}

@@ -81,2 +88,6 @@

if (!_gcstats) {
_gcstats = require('gc-stats');
}
self.handleTimer = self.timers.setTimeout(onHandle, self.handleInterval);

@@ -88,2 +99,5 @@ self.requestTimer =

self.gcStats = new _gcstats();
self.gcStats.on('stats', self._onStatsListener);
function onHandle() {

@@ -122,2 +136,3 @@ self._reportHandle();

_toobusy.shutdown();
self.gcStats.removeListener('stats', self._onStatsListener);
};

@@ -170,1 +185,34 @@

};
ProcessReporter.prototype._reportGCStats = function _reportGCStats(gcInfo) {
var self = this;
var prefix = self.prefix + 'process-reporter.gc.' + formatGCType(gcInfo);
self.statsd.timing(prefix + '.pause-ms', gcInfo.pauseMS);
self.statsd.gauge(prefix + '.heap-used', gcInfo.diff.usedHeapSize);
self.statsd.gauge(prefix + '.heap-total', gcInfo.diff.totalHeapSize);
};
function formatGCType(gcInfo) {
var type;
switch (gcInfo.gctype) {
case 1:
type = 'minor';
break;
case 2:
type = 'major';
break;
case 3:
type = 'both';
break;
default:
type = 'unknown';
break;
}
return type;
}

3

package.json
{
"name": "process-reporter",
"version": "1.1.3",
"version": "2.0.0",
"description": "process reporter",

@@ -9,2 +9,3 @@ "main": "index.js",

"dependencies": {
"gc-stats": "0.0.6",
"process": "^0.11.1",

@@ -11,0 +12,0 @@ "toobusy": "^0.2.4"

@@ -23,3 +23,6 @@ # process-reporter

* **yourapp.process-reporter.lag-sampler** event loop lag
* **yourapp.process-reporter.gc.{gc-type}.pause-ms** length of GC pauses
* **yourapp.process-reporter.gc.{gc-type}.heap-used** +/- amount of bytes GCd
* **yourapp.process-reporter.gc.{gc-type}.heap-total** +/- changes in heap total
To destroy the reporter just call `processReporter.destroy();`
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