Author: zothar
Date: 2006-08-18 14:01:36 +0000 (Fri, 18 Aug 2006)
New Revision: 10188
Modified:
trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
Log:
Add average bandwidth for the life of the node to Total Output and Total Input
on /darknet/ page.
Modified: trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
2006-08-18 13:41:08 UTC (rev 10187)
+++ trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
2006-08-18 14:01:36 UTC (rev 10188)
@@ -144,7 +144,8 @@
double missRoutingDistance =
node.missRoutingDistance.currentValue();
DecimalFormat fix1 = new DecimalFormat("##0.0%");
double backedoffPercent = node.backedoffPercent.currentValue();
- String nodeUptimeString = timeIntervalToString(( now -
node.startupTime ) / 1000);
+ long nodeUptimeSeconds = ( now - node.startupTime ) / 1000;
+ String nodeUptimeString =
timeIntervalToString(nodeUptimeSeconds);
// BEGIN OVERVIEW TABLE
HTMLNode overviewTable = contentNode.addChild("table", "class",
"column");
@@ -194,8 +195,10 @@
activityList.addChild("li",
"ARK\u00a0Fetch\u00a0Requests:\u00a0" + numARKFetchers);
}
long[] total =
IOStatisticCollector.getTotalIO();
- activityList.addChild("li", "Total
Output:\u00a0" + SizeUtil.formatSize(total[0]));
- activityList.addChild("li", "Total
Input:\u00a0" + SizeUtil.formatSize(total[1]));
+ long total_output_rate = (total[0]) /
nodeUptimeSeconds;
+ long total_input_rate = (total[1]) /
nodeUptimeSeconds;
+ activityList.addChild("li", "Total
Output:\u00a0" + SizeUtil.formatSize(total[0]) + "\u00a0(" +
SizeUtil.formatSize(total_output_rate) + "ps)");
+ activityList.addChild("li", "Total
Input:\u00a0" + SizeUtil.formatSize(total[1]) + "\u00a0(" +
SizeUtil.formatSize(total_input_rate) + "ps)");
long[] rate = node.getNodeIOStats();
long delta = (rate[5] - rate[2]) / 1000;
long output_rate = (rate[3] - rate[0]) / delta;