X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fcore%2Fconnection%2FChannelOutboundQueue.java;fp=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fcore%2Fconnection%2FChannelOutboundQueue.java;h=a3ce3d5ef1012d1630df682f23341caad1e96c4e;hb=291ee196f45bd603979c10ecacae117b41c60881;hp=73812930bc69e9783763613895817d6abe08c86d;hpb=d51416320a39973f1cc8fe6de58e6ec769d8ac90;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue.java index 73812930..a3ce3d5e 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue.java @@ -8,6 +8,7 @@ package org.opendaylight.openflowjava.protocol.impl.core.connection; +import com.google.common.base.Preconditions; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandlerContext; @@ -15,19 +16,15 @@ import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.util.concurrent.EventExecutor; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GenericFutureListener; - import java.net.InetSocketAddress; import java.util.Queue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Preconditions; - /** * Channel handler which bypasses wraps on top of normal Netty pipeline, allowing * writes to be enqueued from any thread, it then schedules a task pipeline task, @@ -215,9 +212,11 @@ final class ChannelOutboundQueue extends ChannelInboundHandlerAdapter { channel.flush(); } - final long stop = System.nanoTime(); - LOG.debug("Flushed {} messages in {}us to channel {}", + if (LOG.isDebugEnabled()) { + final long stop = System.nanoTime(); + LOG.debug("Flushed {} messages in {}us to channel {}", messages, TimeUnit.NANOSECONDS.toMicros(stop - start), channel); + } /* * We are almost ready to terminate. This is a bit tricky, because