File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ var sys = require('sys'),
30
30
pool = require ( './../vendor/pool/main' ) ,
31
31
eyes = require ( 'eyes' ) ,
32
32
min = 0 ,
33
- max = 100 ;
33
+ max = 10 ;
34
34
35
35
// Setup the PoolManager
36
36
var manager = pool . createPoolManager ( ) ;
@@ -146,7 +146,7 @@ HttpProxy.prototype = {
146
146
147
147
// Open new HTTP request to internal resource with will act as a reverse proxy pass
148
148
var p = manager . getPool ( port , server ) ;
149
- sys . puts ( 'current pool count for ' + req . headers . host + ":" + port + ' ' + p . clients . length ) ;
149
+ sys . puts ( 'Current pool count for ' + req . headers . host + ":" + port + ' ' + p . clients . length + ', Busy: ' + p . getBusy ( ) + ', Free: ' + p . getFree ( ) ) ;
150
150
151
151
p . on ( 'error' , function ( err ) {
152
152
// Remark: We should probably do something here
Original file line number Diff line number Diff line change @@ -84,6 +84,14 @@ Pool.prototype.onFree = function (client) {
84
84
if ( this . pending . length > 0 ) this . pending . shift ( ) ( client ) ;
85
85
} ;
86
86
87
+ Pool . prototype . getFree = function ( ) {
88
+ return this . clients . filter ( function ( client ) { return ! client . busy } ) . length ;
89
+ } ;
90
+
91
+ Pool . prototype . getBusy = function ( ) {
92
+ return this . clients . filter ( function ( client ) { return client . busy } ) . length ;
93
+ } ;
94
+
87
95
Pool . prototype . setMinClients = function ( num ) {
88
96
this . minClients = num ;
89
97
if ( this . clients . length < num ) {
@@ -98,6 +106,7 @@ Pool.prototype.setMinClients = function (num) {
98
106
Pool . prototype . setMaxClients = function ( num ) {
99
107
this . maxClients = num ;
100
108
} ;
109
+
101
110
Pool . prototype . end = function ( ) {
102
111
this . clients . forEach ( function ( c ) { c . end ( ) } ) ;
103
112
} ;
You can’t perform that action at this time.
0 commit comments