I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit d4bbdc28 authored by dg2-new's avatar dg2-new
Browse files

FloodfillMonitorJob: use the 60 min rate avg instead of lifetime avg, but fallback to the lifetime.

SAMStreamSend: fix tabbing from earlier commit.
parent f41df969
No related branches found
No related tags found
No related merge requests found
...@@ -174,7 +174,7 @@ public class SAMStreamSend { ...@@ -174,7 +174,7 @@ public class SAMStreamSend {
} }
public boolean openConnection() { public boolean openConnection() {
FileInputStream fin = null; FileInputStream fin = null;
try { try {
fin = new FileInputStream(_destFile); fin = new FileInputStream(_destFile);
byte dest[] = new byte[1024]; byte dest[] = new byte[1024];
......
...@@ -31,6 +31,7 @@ class FloodfillMonitorJob extends JobImpl { ...@@ -31,6 +31,7 @@ class FloodfillMonitorJob extends JobImpl {
private static final int REQUEUE_DELAY = 60*60*1000; private static final int REQUEUE_DELAY = 60*60*1000;
private static final long MIN_UPTIME = 2*60*60*1000; private static final long MIN_UPTIME = 2*60*60*1000;
private static final long MIN_CHANGE_DELAY = 6*60*60*1000; private static final long MIN_CHANGE_DELAY = 6*60*60*1000;
private static final int MIN_FF = 5000; private static final int MIN_FF = 5000;
private static final int MAX_FF = 999999; private static final int MAX_FF = 999999;
private static final String PROP_FLOODFILL_PARTICIPANT = "router.floodfillParticipant"; private static final String PROP_FLOODFILL_PARTICIPANT = "router.floodfillParticipant";
...@@ -151,9 +152,9 @@ class FloodfillMonitorJob extends JobImpl { ...@@ -151,9 +152,9 @@ class FloodfillMonitorJob extends JobImpl {
boolean happy = getContext().router().getRouterInfo().getCapabilities().indexOf("R") >= 0; boolean happy = getContext().router().getRouterInfo().getCapabilities().indexOf("R") >= 0;
// TODO - limit may still be too high // TODO - limit may still be too high
// For reference, the avg lifetime job lag on my Pi is 6. // For reference, the avg lifetime job lag on my Pi is 6.
// Would per-hour or per-day be better than lifetime avg? A reference to avg. dropped ff jobs maybe? // Should we consider avg. dropped ff jobs?
RateStat lagStat = getContext().statManager().getRate("jobQueue.jobLag"); RateStat lagStat = getContext().statManager().getRate("jobQueue.jobLag");
happy = happy && lagStat.getLifetimeAverageValue() < 25; happy = happy && lagStat.getRate(60*60*1000L).getAvgOrLifetimeAvg() < 25;
happy = happy && getContext().tunnelManager().getInboundBuildQueueSize() < 5; happy = happy && getContext().tunnelManager().getInboundBuildQueueSize() < 5;
// Only if we're pretty well integrated... // Only if we're pretty well integrated...
happy = happy && _facade.getKnownRouters() >= 200; happy = happy && _facade.getKnownRouters() >= 200;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment