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

cluster2

Package Overview
Dependencies
Maintainers
6
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster2 - npm Package Compare versions

Comparing version 0.4.12 to 0.4.13

68

lib/process.js

@@ -29,4 +29,3 @@ /*

getrusage = require('getrusage'),
memwatch = require('memwatch'),
proc = require('proc');
memwatch = require('memwatch');

@@ -589,38 +588,37 @@ var debug = process.env['cluster2'];

proc.psinfo(process.pid, function(err, result){
var memUsage = process.memoryUsage(),
heartbeat = {
'pid': process.pid,
'usertime': getrusage.getcputime(),
'systime': getrusage.getsystemtime(),
'uptime': Math.round(process.uptime()),
'totalmem': !err ? result.pr_size : memUsage.heapTotal,
'freemem': !err ? result.pr_size * (1 - result.pr_pctmem) : memUsage.heapTotal - memUsage.heapUsed,
'totalConnections': totalConns,
'pendingConnections': conns,
'timedoutConnections': timedoutConns,
'fullGCs': memStats['num_full_gc'],
'incrementalGCs': memStats['num_inc_gc'],
'heapCompactions': memStats['heap_compactions'],
'totalTransactions': txStats.count,
'totalDuration': txStats.totalDuration,
'errors': errors
};
self.emitter.emit('heartbeat', heartbeat);
var toMaster = {
type:"heartbeat"
var memUsage = process.memoryUsage(),
memTotal = Math.pow(2, 31) - 1,//should be 4g full space, but that exceeds MAX_INT, reduce it to MAX_INT
heartbeat = {
'pid': process.pid,
'usertime': getrusage.getcputime(),
'systime': getrusage.getsystemtime(),
'uptime': Math.round(process.uptime()),
'totalmem': memTotal,
'freemem': memTotal - memUsage.heapTotal,
'totalConnections': totalConns,
'pendingConnections': conns,
'timedoutConnections': timedoutConns,
'fullGCs': memStats['num_full_gc'],
'incrementalGCs': memStats['num_inc_gc'],
'heapCompactions': memStats['heap_compactions'],
'totalTransactions': txStats.count,
'totalDuration': txStats.totalDuration,
'errors': errors
};
_.extend(toMaster, heartbeat);
process.send(toMaster);
self.emitter.emit('heartbeat', heartbeat);
var toMaster = {
type:"heartbeat"
};
_.extend(toMaster, heartbeat);
memStats.num_full_gc = 0;
memStats.num_inc_gc = 0;
memStats.heap_compactions = 0;
txStats.count = 0;
txStats.totalDuration = 0;
errors = 0;
});
process.send(toMaster);
memStats.num_full_gc = 0;
memStats.num_inc_gc = 0;
memStats.heap_compactions = 0;
txStats.count = 0;
txStats.totalDuration = 0;
errors = 0;
}, self.options.heartbeatInterval || 60000);

@@ -627,0 +625,0 @@

@@ -8,3 +8,3 @@ {

"name": "cluster2",
"version": "0.4.12",
"version": "0.4.13",
"repository": {

@@ -25,4 +25,3 @@ "type": "git",

"memwatch": "~0.2.2",
"getrusage": "~0.3.3",
"proc": "~0.2.2"
"getrusage": "~0.3.3"
},

@@ -29,0 +28,0 @@ "devDependencies": {

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