Author: toad
Date: 2008-02-28 18:26:19 +0000 (Thu, 28 Feb 2008)
New Revision: 18216

Modified:
   trunk/freenet/src/freenet/io/xfer/PacketThrottle.java
Log:
Logging

Modified: trunk/freenet/src/freenet/io/xfer/PacketThrottle.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/PacketThrottle.java       2008-02-28 
18:21:29 UTC (rev 18215)
+++ trunk/freenet/src/freenet/io/xfer/PacketThrottle.java       2008-02-28 
18:26:19 UTC (rev 18216)
@@ -159,6 +159,7 @@
        }

        public void sendThrottledMessage(Message msg, PeerContext peer, 
DoubleTokenBucket overallThrottle, int packetSize, ByteCounter ctr) throws 
NotConnectedException {
+               long start = System.currentTimeMillis();
                synchronized(this) {
                        while(true) {
                                int windowSize = (int) getWindowSize();
@@ -180,6 +181,11 @@
                                }
                        }
                }
+               long waitTime = System.currentTimeMillis() - start;
+               if(waitTime > 60*1000)
+                       Logger.error(this, "Congestion control wait time: 
"+waitTime+" for "+this);
+               else if(logMINOR)
+                       Logger.minor(this, "Congestion control wait time: 
"+waitTime+" for "+this);
                MyCallback callback = new MyCallback();
                try {
                        if(((PeerNode)peer).isLocalAddress()) {


Reply via email to