- Job Queue/stats: add stat/graph for amount of scheduled jobs (router.tunnelBacklog)

- FloodfillMonitorJob:
  - Use avg of router.tunnelBacklog instead of current backlog
- Some language/spelling fixes
This commit is contained in:
dg2-new
2015-05-12 18:46:40 +00:00
parent 287862887d
commit 8303016b48
22 changed files with 28 additions and 22 deletions

View File

@@ -31,7 +31,7 @@ public class TunnelDataMessage extends FastI2NPMessageImpl {
public final static int MESSAGE_TYPE = 18;
public static final int DATA_SIZE = 1024;
/** if we can't deliver a tunnel message in 10s, fuck it */
/** if we can't deliver a tunnel message in 10s, forget it */
private static final int EXPIRATION_PERIOD = 10*1000;
private static final ByteCache _cache;

View File

@@ -25,7 +25,7 @@ public class TunnelGatewayMessage extends FastI2NPMessageImpl {
//private Exception _creator;
public final static int MESSAGE_TYPE = 19;
/** if we can't deliver a tunnel message in 10s, fuck it */
/** if we can't deliver a tunnel message in 10s, forget it */
private static final int EXPIRATION_PERIOD = 10*1000;
public TunnelGatewayMessage(I2PAppContext context) {

View File

@@ -642,7 +642,6 @@ public class Router implements RouterClock.ClockShiftListener {
File f = new File(filename);
if (f.canRead()) {
DataHelper.loadProps(props, f);
// dont be a wanker
props.remove(PROP_SHUTDOWN_IN_PROGRESS);
} else {
if (log != null)

View File

@@ -160,7 +160,9 @@ class FloodfillMonitorJob extends JobImpl {
// For reference, the avg lifetime job lag on my Pi is 6.
// Should we consider avg. dropped ff jobs?
RateStat lagStat = getContext().statManager().getRate("jobQueue.jobLag");
RateStat queueStat = getContext().statManager().getRate("router.tunnelBacklog");
happy = happy && lagStat.getRate(60*60*1000L).getAvgOrLifetimeAvg() < 25;
happy = happy && getContext().tunnelManager().queueStat.getRate(60*60*1000L).getAvgOrLifetimeAvg() < 5;
happy = happy && getContext().tunnelManager().getInboundBuildQueueSize() < 5;
// Only if we're pretty well integrated...
happy = happy && _facade.getKnownRouters() >= 400;

View File

@@ -39,6 +39,7 @@ public class CoalesceStatsEvent implements SimpleTimer.TimedEvent {
ctx.statManager().createRateStat("router.activeSendPeers", "How many peers we've sent to this minute", "Throttle", new long[] { 60*1000, 5*60*1000, 60*60*1000 });
ctx.statManager().createRequiredRateStat("router.fastPeers", _x("Known fast peers"), "Throttle", new long[] { 5*60*1000, 60*60*1000 });
ctx.statManager().createRateStat("router.integratedPeers", _x("Known integrated (floodfill) peers"), "Throttle", new long[] { 60*1000, 5*60*1000, 60*60*1000 });
ctx.statManager().createRateStat("router.tunnelBacklog", _x("Size of tunnel acceptor backlog"), "Tunnels", new long[] { 60*1000, 5*60*1000, 60*60*1000 });
_maxMemory = Runtime.getRuntime().maxMemory();
String legend = "(Bytes)";
if (_maxMemory < Long.MAX_VALUE)
@@ -68,6 +69,7 @@ public class CoalesceStatsEvent implements SimpleTimer.TimedEvent {
getContext().statManager().addRateData("bw.sendRate", (long)getContext().bandwidthLimiter().getSendBps());
getContext().statManager().addRateData("bw.recvRate", (long)getContext().bandwidthLimiter().getReceiveBps());
getContext().statManager().addRateData("router.tunnelBacklog", getContext().tunnelManager().getInboundBuildQueueSize(), 60*1000);
long used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
getContext().statManager().addRateData("router.memoryUsed", used);
if (_maxMemory - used < LOW_MEMORY_THRESHOLD)

View File

@@ -11,7 +11,7 @@ import net.i2p.util.Log;
/**
* Priority Blocking Queue using methods in the entries,
* as definied in PQEntry, to store priority and sequence number,
* as defined in PQEntry, to store priority and sequence number,
* ensuring FIFO order within a priority.
*
* Input: add(), offer(), and put() are overridden to add a sequence number.

View File

@@ -131,7 +131,7 @@ public class BatchedFragmentTest extends FragmentTest {
*/
public void runBatches() {
//success += testBatched(1, false, false, 1024, false, false);
// this takes a long fucking time
// this takes a long long time
for (int i = 1; i <= 1024; i++) {
testBatched(i, false, false, 1024, false, false, 1024, false, false);
testBatched(i, true, false, 1024, false, false, 1024, false, false);