agentkeepalive
Advanced tools
Comparing version 1.0.0 to 1.1.0
1.1.0 / 2014-08-28 | ||
================== | ||
* add some socket counter for deep monitor | ||
1.0.0 / 2014-08-13 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -108,4 +108,4 @@ // Copyright Joyent, Inc. and other Node contributors. | ||
socket._onKeepAliveTimeout = function () { | ||
// debug('free socket timeout', name); | ||
this.destroy(); | ||
self.emit('timeout'); | ||
}; | ||
@@ -236,2 +236,3 @@ } | ||
self.removeSocket(s, options); | ||
self.emit('close'); | ||
} | ||
@@ -238,0 +239,0 @@ s.on('close', onClose); |
@@ -23,6 +23,7 @@ /**! | ||
var debug = util.debuglog('http'); | ||
var OriginalAgent = require('./_http_agent').Agent; | ||
var OriginalHttpsAgent = https.Agent; | ||
module.exports = Agent; | ||
function Agent(options) { | ||
@@ -32,3 +33,3 @@ if (!(this instanceof Agent)) { | ||
} | ||
options = options || {}; | ||
@@ -39,6 +40,20 @@ // default is keep-alive and 15s free socket timeout | ||
OriginalAgent.call(this, options); | ||
var self = this; | ||
self.createSocketCount = 0; | ||
self.closeSocketCount = 0; | ||
self.requestCount = 0; | ||
self.timeoutSocketCount = 0; | ||
self.on('free', function () { | ||
self.requestCount++; | ||
}); | ||
self.on('timeout', function () { | ||
self.timeoutSocketCount++; | ||
}); | ||
self.on('close', function () { | ||
self.closeSocketCount++; | ||
}); | ||
} | ||
util.inherits(Agent, OriginalAgent); | ||
module.exports = Agent; | ||
@@ -51,2 +66,3 @@ Agent.prototype.createSocket = function (req, options) { | ||
} | ||
this.createSocketCount++; | ||
return socket; | ||
@@ -53,0 +69,0 @@ }; |
{ | ||
"name": "agentkeepalive", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Missing keepalive http.Agent", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
28578
402