small optimization on channelPC creation

This commit is contained in:
Frédéric Brégier 2009-03-19 22:17:51 +00:00
parent cb6269ca4c
commit 8db746d3fd

View File

@ -343,7 +343,8 @@ public abstract class PerformanceCounterFactory {
* disabled * disabled
*/ */
public PerformanceCounter createChannelPerformanceCounter(Channel channel) { public PerformanceCounter createChannelPerformanceCounter(Channel channel) {
if (this.channelActive) { if (this.channelActive && ((this.channelLimitRead > NO_LIMIT) || (this.channelLimitWrite > NO_LIMIT)
|| (this.channelDelay > NO_STAT))) {
return new PerformanceCounter(this, this.executorService, channel, return new PerformanceCounter(this, this.executorService, channel,
"ChannelPC" + channel.getId(), this.channelLimitWrite, "ChannelPC" + channel.getId(), this.channelLimitWrite,
this.channelLimitRead, this.channelDelay); this.channelLimitRead, this.channelDelay);