Comparing version 0.4.12 to 0.4.13
@@ -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": { |
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
7
109328
1768
- Removedproc@~0.2.2
- Removedproc@0.2.2(transitive)