Skip to content

Commit 7600254

Browse files
committed
Remove debugging code
1 parent cef9a48 commit 7600254

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

src/main/java/com/rabbitmq/client/impl/NettyFrameHandlerFactory.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
import java.net.InetSocketAddress;
5353
import java.net.SocketAddress;
5454
import java.time.Duration;
55-
import java.util.Queue;
56-
import java.util.concurrent.ConcurrentLinkedQueue;
5755
import java.util.concurrent.CountDownLatch;
5856
import java.util.concurrent.ExecutionException;
5957
import java.util.concurrent.TimeUnit;
@@ -355,7 +353,6 @@ public void writeFrame(Frame frame) throws IOException {
355353
if (canWriteNow) {
356354
this.doWriteFrame(frame);
357355
} else {
358-
this.handler.logEvents();
359356
throw new IOException("Frame enqueuing failed");
360357
}
361358
} catch (InterruptedException e) {
@@ -485,42 +482,9 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
485482
}
486483
}
487484

488-
private static class Event {
489-
private final long time;
490-
private final String label;
491-
492-
public Event(long time, String label) {
493-
this.time = time;
494-
this.label = label;
495-
}
496-
497-
@Override
498-
public String toString() {
499-
return this.label + " " + this.time;
500-
}
501-
}
502-
503-
private static final int MAX_EVENTS = 100;
504-
private final Queue<Event> events = new ConcurrentLinkedQueue<>();
505-
506-
private void logEvents() {
507-
if (this.events.size() > 0) {
508-
long start = this.events.peek().time;
509-
LOGGER.info("channel writability history:");
510-
events.forEach(e -> LOGGER.info("{}: {}", (e.time - start) / 1_000_000, e.label));
511-
}
512-
}
513-
514485
@Override
515486
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
516487
boolean canWrite = ctx.channel().isWritable();
517-
Event event = new Event(System.nanoTime(), Boolean.toString(canWrite));
518-
if (this.events.size() >= MAX_EVENTS) {
519-
this.events.poll();
520-
this.events.offer(event);
521-
}
522-
this.events.add(event);
523-
524488
if (this.writable.compareAndSet(!canWrite, canWrite)) {
525489
if (canWrite) {
526490
CountDownLatch latch = writableLatch.getAndSet(new CountDownLatch(1));

0 commit comments

Comments
 (0)