Comparing version 0.4.9 to 0.4.11
@@ -18,7 +18,5 @@ /* | ||
var misc = require('./misc.js'), | ||
express = require('express'), | ||
ejs = require('ejs'), | ||
fs = require('fs'), | ||
util = require('util'), | ||
npm = require('npm'), | ||
os = require('os'), | ||
@@ -35,2 +33,3 @@ _ = require('underscore'); | ||
if(!app){ | ||
var express = require('express'); | ||
app = express.createServer(); | ||
@@ -89,2 +88,3 @@ | ||
app.get('/deps', function(req, res) { | ||
var npm = require('npm'); | ||
npm.load({}, function() { | ||
@@ -91,0 +91,0 @@ npm.commands.ls([], true, function(e, data) { |
@@ -190,2 +190,3 @@ /* | ||
'totalDuration': aggr.totalDuration,//total | ||
'errors': aggr.errors,//total | ||
'threads': _.keys(threads).length, | ||
@@ -577,21 +578,30 @@ 'interval': Date.now() - self.lastTime | ||
var errors = 0; | ||
self.emitter.on('errorTransaction', function(){ | ||
errors += 1; | ||
}); | ||
// Heartbeat - make sure to clear this on 'close' | ||
var heartbeat = setInterval(function () { | ||
var heartbeat = { | ||
'pid': process.pid, | ||
'usertime': getrusage.getcputime(), | ||
'systime': getrusage.getsystemtime(), | ||
'uptime': Math.round(process.uptime()), | ||
'totalmem': os.totalmem(), | ||
'freemem': os.freemem(), | ||
'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 | ||
}; | ||
var memUsage = process.memoryUsage(), | ||
heartbeat = { | ||
'pid': process.pid, | ||
'usertime': getrusage.getcputime(), | ||
'systime': getrusage.getsystemtime(), | ||
'uptime': Math.round(process.uptime()), | ||
'totalmem': memUsage.heapTotal, | ||
'freemem': 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 | ||
}; | ||
@@ -611,2 +621,3 @@ self.emitter.emit('heartbeat', heartbeat); | ||
txStats.totalDuration = 0; | ||
errors = 0; | ||
@@ -613,0 +624,0 @@ }, self.options.heartbeatInterval || 60000); |
@@ -8,3 +8,3 @@ { | ||
"name": "cluster2", | ||
"version": "0.4.9", | ||
"version": "0.4.11", | ||
"repository": { | ||
@@ -11,0 +11,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
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
1767
105474
24