diff --git a/apps/routerconsole/jsp/summary.jsp b/apps/routerconsole/jsp/summary.jsp
index 475dd60c8..dc92a174b 100644
--- a/apps/routerconsole/jsp/summary.jsp
+++ b/apps/routerconsole/jsp/summary.jsp
@@ -40,7 +40,7 @@
Active: /
Fast:
High capacity:
-
+ Well integrated:
Failing:
Known:
<%
diff --git a/history.txt b/history.txt
index 45477f9f3..c39bc7515 100644
--- a/history.txt
+++ b/history.txt
@@ -1,3 +1,14 @@
+2008-03-11 zzz
+ * ProfileOrganizer:
+ - Don't require a peer to be high-capacity to be
+ well-integrated (not used for anything right now,
+ but want to get it right for possible floodfill verification)
+ - Don't fall back to median for high-capacity threshold
+ if the mean is higher than the median, this prevents
+ frequent large high-capacity counts
+ - Fix high-capacity selector that picked one too many
+ * Console: put well-integrated count back in the summary
+
2008-03-10 zzz
* EepGet: Fix byte count for bytesTransferred status listeners
(fixes command line status)
diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java
index 7c973ae33..0a191ed32 100644
--- a/router/java/src/net/i2p/router/RouterVersion.java
+++ b/router/java/src/net/i2p/router/RouterVersion.java
@@ -17,7 +17,7 @@ import net.i2p.CoreVersion;
public class RouterVersion {
public final static String ID = "$Revision: 1.548 $ $Date: 2008-02-10 15:00:00 $";
public final static String VERSION = "0.6.1.32";
- public final static long BUILD = 3;
+ public final static long BUILD = 4;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);
diff --git a/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java b/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java
index 78f9086c3..6747bd6f1 100644
--- a/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java
+++ b/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java
@@ -653,7 +653,10 @@ public class ProfileOrganizer {
locked_calculateCapacityThreshold(totalCapacity, reordered);
locked_calculateSpeedThreshold(reordered);
- _thresholdIntegrationValue = 1.0d * avg(totalIntegration, reordered.size());
+ if (totalIntegration > 0)
+ _thresholdIntegrationValue = 1.0d * avg(totalIntegration, reordered.size());
+ else // Make nobody rather than everybody well-integrated
+ _thresholdIntegrationValue = 1.0d;
}
/**
@@ -685,7 +688,7 @@ public class ProfileOrganizer {
numExceedingMean++;
if (cur == reordered.size()/2)
thresholdAtMedian = val;
- if (cur == minHighCapacityPeers)
+ if (cur == minHighCapacityPeers - 1)
thresholdAtMinHighCap = val;
if (cur == reordered.size() -1)
thresholdAtLowest = val;
@@ -698,12 +701,20 @@ public class ProfileOrganizer {
_log.info("Our average capacity is doing well [" + meanCapacity
+ "], and includes " + numExceedingMean);
_thresholdCapacityValue = meanCapacity;
-// else if mean > median && reordered.size > minHighCapacitiyPeers then threshold = reordered.get(minHighCapacity).getCapacityValue()
+ } else if (meanCapacity > thresholdAtMedian &&
+ reordered.size()/2 > minHighCapacityPeers) {
+ // avg > median, get the min High Cap peers
+ if (_log.shouldLog(Log.INFO))
+ _log.info("Our average capacity [" + meanCapacity + "] is greater than the median,"
+ + " so threshold is that reqd to get the min high cap peers " + thresholdAtMinHighCap);
+ _thresholdCapacityValue = thresholdAtMinHighCap;
} else if (reordered.size()/2 >= minHighCapacityPeers) {
// ok mean is skewed low, but we still have enough to use the median
+ // We really don't want to be here, since the default is 5.0 and the median
+ // is inevitably 5.01 or so.
if (_log.shouldLog(Log.INFO))
- _log.info("Our average capacity is skewed under the median [" + meanCapacity
- + "], so use the median threshold " + thresholdAtMedian);
+ _log.info("Our average capacity [" + meanCapacity + "] is skewed under the median,"
+ + " so use the median threshold " + thresholdAtMedian);
_thresholdCapacityValue = thresholdAtMedian;
} else {
// our average is doing well, but not enough peers
@@ -979,14 +990,19 @@ public class ProfileOrganizer {
}
}
- if (_thresholdIntegrationValue <= profile.getIntegrationValue()) {
- _wellIntegratedPeers.put(profile.getPeer(), profile);
- if (_log.shouldLog(Log.DEBUG))
- _log.debug("Integrated: \t" + profile.getPeer().toBase64());
- }
} else {
// not high capacity, but not failing (yet)
}
+ // We aren't using the well-integrated list yet...
+ // But by observation, the floodfill peers are often not in the
+ // high-capacity group, so let's not require a peer to be high-capactiy
+ // to call him well-integrated.
+ // This could be used later to see if a floodfill peer is for real.
+ if (_thresholdIntegrationValue <= profile.getIntegrationValue()) {
+ _wellIntegratedPeers.put(profile.getPeer(), profile);
+ if (_log.shouldLog(Log.DEBUG))
+ _log.debug("Integrated: \t" + profile.getPeer().toBase64());
+ }
}
}