agentkeepalive
Advanced tools
Comparing version 3.2.0 to 3.3.0
3.3.0 / 2017-06-20 | ||
================== | ||
* feat: add statusChanged getter (#51) | ||
* chore: format License | ||
3.2.0 / 2017-06-10 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -42,8 +42,20 @@ /** | ||
this.createSocketCount = 0; | ||
this.createSocketCountLastCheck = 0; | ||
this.createSocketErrorCount = 0; | ||
this.createSocketErrorCountLastCheck = 0; | ||
this.closeSocketCount = 0; | ||
this.closeSocketCountLastCheck = 0; | ||
// socket error event count | ||
this.errorSocketCount = 0; | ||
this.errorSocketCountLastCheck = 0; | ||
this.requestCount = 0; | ||
this.requestCountLastCheck = 0; | ||
this.timeoutSocketCount = 0; | ||
this.timeoutSocketCountLastCheck = 0; | ||
this.on('free', s => { | ||
@@ -81,2 +93,20 @@ this.requestCount++; | ||
get statusChanged() { | ||
const changed = this.createSocketCount !== this.createSocketCountLastCheck || | ||
this.createSocketErrorCount !== this.createSocketErrorCountLastCheck || | ||
this.closeSocketCount !== this.closeSocketCountLastCheck || | ||
this.errorSocketCount !== this.errorSocketCountLastCheck || | ||
this.timeoutSocketCount !== this.timeoutSocketCountLastCheck || | ||
this.requestCount !== this.requestCountLastCheck; | ||
if (changed) { | ||
this.createSocketCountLastCheck = this.createSocketCount; | ||
this.createSocketErrorCountLastCheck = this.createSocketErrorCount; | ||
this.closeSocketCountLastCheck = this.closeSocketCount; | ||
this.errorSocketCountLastCheck = this.errorSocketCount; | ||
this.timeoutSocketCountLastCheck = this.timeoutSocketCount; | ||
this.requestCountLastCheck = this.requestCount; | ||
} | ||
return changed; | ||
} | ||
getCurrentStatus() { | ||
@@ -83,0 +113,0 @@ return { |
{ | ||
"name": "agentkeepalive", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"description": "Missing keepalive http.Agent", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -62,3 +62,3 @@ # agentkeepalive | ||
Default = `256`. | ||
* `socketActiveTTL` {Number} Sets the socket active time to live, even if it's in use. | ||
* `socketActiveTTL` {Number} Sets the socket active time to live, even if it's in use. | ||
If not setted the behaviour continues the same (the socket will be released only when free) | ||
@@ -102,3 +102,5 @@ Default = `null`. | ||
setTimeout(() => { | ||
console.log('agent status: %j', keepaliveAgent.getCurrentStatus()); | ||
if (keepaliveAgent.statusChanged) { | ||
console.log('[%s] agent status changed: %j', Date(), keepaliveAgent.getCurrentStatus()); | ||
} | ||
}, 2000); | ||
@@ -108,2 +110,6 @@ | ||
### `getter agent.statusChanged` | ||
counters have change or not after last checkpoint. | ||
### `agent.getCurrentStatus()` | ||
@@ -221,6 +227,7 @@ | ||
``` | ||
(The MIT License) | ||
Copyright(c) node-modules and other contributors. | ||
Copyright(c) 2012 - 2015 fengmk2 <fengmk2@gmail.com> | ||
Copyright(c) node-modules and other contributors. | ||
@@ -245,1 +252,2 @@ Permission is hereby granted, free of charge, to any person obtaining | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
``` |
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
29873
502
249