Author: ljn1981
Date: 2006-09-09 22:26:24 +0000 (Sat, 09 Sep 2006)
New Revision: 10446
Modified:
trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
trunk/freenet/src/freenet/node/LocationManager.java
Log:
Well bombe's optimization helped speed but it turns out it's not working right,
I suspect the casting is wrong...
Modified: trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
2006-09-09 21:26:42 UTC (rev 10445)
+++ trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
2006-09-09 22:26:24 UTC (rev 10446)
@@ -142,6 +142,7 @@
int bwlimitDelayTime = (int) node.getBwlimitDelayTime();
int nodeAveragePingTime = (int)
node.getNodeAveragePingTime();
int networkSizeEstimateSession =
node.getNetworkSizeEstimate(-1);
+ //int networkSizeEstimateDay =
node.getNetworkSizeEstimate(now-86400000);
DecimalFormat fix4 = new DecimalFormat("0.0000");
double missRoutingDistance =
node.missRoutingDistance.currentValue();
DecimalFormat fix1 = new DecimalFormat("##0.0%");
@@ -163,6 +164,7 @@
overviewList.addChild("li",
"bwlimitDelayTime:\u00a0" + bwlimitDelayTime + "ms");
overviewList.addChild("li",
"nodeAveragePingTime:\u00a0" + nodeAveragePingTime + "ms");
overviewList.addChild("li",
"networkSizeEstimateSession:\u00a0" + networkSizeEstimateSession +
"\u00a0nodes");
+ //overviewList.addChild("li",
"networkSizeEstimateDay:\u00a0" + networkSizeEstimateDay + "\u00a0nodes");
overviewList.addChild("li", "nodeUptime:\u00a0"
+ nodeUptimeString);
overviewList.addChild("li",
"missRoutingDistance:\u00a0" + fix4.format(missRoutingDistance));
overviewList.addChild("li",
"backedoffPercent:\u00a0" + fix1.format(backedoffPercent));
Modified: trunk/freenet/src/freenet/node/LocationManager.java
===================================================================
--- trunk/freenet/src/freenet/node/LocationManager.java 2006-09-09 21:26:42 UTC
(rev 10445)
+++ trunk/freenet/src/freenet/node/LocationManager.java 2006-09-09 22:26:24 UTC
(rev 10446)
@@ -984,10 +984,10 @@
else if (timestamp > -1) {
Date threshold = new Date(timestamp);
int numberOfLocationsInPeriod = 0;
- //TODO Optimize so it doesn't take forever..
Iterator knownLocationsIterator =
knownLocs.values().iterator();
while (knownLocationsIterator.hasNext()) {
- if (threshold.after((Date)
knownLocationsIterator.next())) {
+ //FIXME: It's not counting :(
+ if
(threshold.after((Date)knownLocationsIterator.next())) {
numberOfLocationsInPeriod++;
}
}