Skip to content

Commit 1f2cc2c

Browse files
author
Stephane Landelle
committed
Make NettyConnectionsPool properly trace open channels, fix AsyncHttpClient#222
1 parent 98872c9 commit 1f2cc2c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

providers/netty/src/main/java/com/ning/http/client/providers/netty/NettyConnectionsPool.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,14 @@ public void run() {
129129
}
130130
}
131131

132-
if (log.isTraceEnabled())
132+
if (log.isTraceEnabled()) {
133+
int openChannels = 0;
134+
for (ConcurrentLinkedQueue<IdleChannel> hostChannels: connectionsPool.values()) {
135+
openChannels += hostChannels.size();
136+
}
133137
log.trace(String.format("%d channel open, %d idle channels closed (times: 1st-loop=%d, 2nd-loop=%d).\n",
134-
connectionsPool.size(), channelsInTimeout.size(), endConcurrentLoop - currentTime, System.currentTimeMillis() - endConcurrentLoop));
138+
openChannels, channelsInTimeout.size(), endConcurrentLoop - currentTime, System.currentTimeMillis() - endConcurrentLoop));
139+
}
135140
} catch (Throwable t) {
136141
log.error("uncaught exception!", t);
137142
}

0 commit comments

Comments
 (0)