stat and log tweaks

This commit is contained in:
zzz
2012-09-02 00:45:58 +00:00
parent f44eeaf7dd
commit 4360284355
2 changed files with 8 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import net.i2p.I2PAppContext;
import net.i2p.data.DataHelper;
import net.i2p.util.Log;
/**
@@ -61,7 +62,7 @@ public class CoDelBlockingQueue<E extends CDQEntry> extends LinkedBlockingQueue<
private final String STAT_DROP;
private final String STAT_DELAY;
private static final long[] RATES = {5*60*1000};
private static final long[] RATES = {5*60*1000, 60*60*1000};
/**
* @param name for stats
@@ -263,6 +264,8 @@ public class CoDelBlockingQueue<E extends CDQEntry> extends LinkedBlockingQueue<
_context.statManager().addRateData(STAT_DROP, delay);
if (_log.shouldLog(Log.WARN))
_log.warn(_name + " dropped item with delay " + delay + ", " +
DataHelper.formatDuration(_context.clock().now() - _first_above_time) + " since first above, " +
(_count+1) + " dropped in this phase, " +
size() + " remaining in queue: " + entry);
entry.drop();
}

View File

@@ -7,6 +7,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import net.i2p.I2PAppContext;
import net.i2p.data.DataHelper;
import net.i2p.util.Log;
/**
@@ -66,7 +67,7 @@ public class CoDelPriorityBlockingQueue<E extends CDPQEntry> extends PriorityBlo
private final String STAT_DROP;
private final String STAT_DELAY;
private static final long[] RATES = {5*60*1000};
private static final long[] RATES = {5*60*1000, 60*60*1000};
public static final int MIN_PRIORITY = 100;
private static final int[] PRIORITIES = {MIN_PRIORITY, 200, 300, 400, 500};
/** if priority is >= this, never drop */
@@ -285,6 +286,8 @@ public class CoDelPriorityBlockingQueue<E extends CDPQEntry> extends PriorityBlo
_log.warn(_name + " dropped item with delay " + delay + ", priority " +
entry.getPriority() + ", seq " +
entry.getSeqNum() + ", " +
DataHelper.formatDuration(_context.clock().now() - _first_above_time) + " since first above, " +
(_count+1) + " dropped in this phase, " +
size() + " remaining in queue: " + entry);
entry.drop();
}