Author: nextgens
Date: 2008-08-15 19:51:51 +0000 (Fri, 15 Aug 2008)
New Revision: 21917

Modified:
   trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
Log:
StatisticToadlet: don't create HTMLNodes there: it's way faster not to

Modified: trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java       
2008-08-15 19:22:32 UTC (rev 21916)
+++ trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java       
2008-08-15 19:51:51 UTC (rev 21917)
@@ -1110,6 +1110,7 @@
                        strength = 1 - ((double) age / MAX_CIRCLE_AGE_THRESHOLD 
);
                        histogramIndex = (int) 
(Math.floor(location.doubleValue() * HISTOGRAM_LENGTH));
                        histogram[histogramIndex]++;
+                       
                        nodeCircleInfoboxContent.addChild("span", new String[] 
{ "style", "class" }, new String[] { 
generatePeerCircleStyleString(location.doubleValue(), false, strength), 
"connected" }, "x");
                }
                nodeCircleInfoboxContent.addChild("span", new String[] { 
"style", "class" }, new String[] { generatePeerCircleStyleString(myLocation, 
true, 1.0), "me" }, "x");
@@ -1119,9 +1120,10 @@
                        nodeHistogramLegendCell = 
nodeHistogramLegendTableRow.addChild("td");
                        nodeHistogramGraphCell = 
nodeHistogramGraphTableRow.addChild("td", "style", "height: 100px;");
                        nodeHistogramLegendCell.addChild("div", "class", 
"histogramLabel").addChild("#", fix1p1.format(((double) i) / HISTOGRAM_LENGTH 
));
-                       //
                        histogramPercent = ((double) histogram[ i ] ) / 
nodeCount;
-                       nodeHistogramGraphCell.addChild("div", new String[] { 
"class", "style" }, new String[] { "histogramConnected", "height: " + 
fix3pctUS.format(histogramPercent) + "; width: 100%;" }, "\u00a0");
+                       
+                       // Don't use HTMLNode here to speed things up
+                       nodeHistogramGraphCell.addChild("%", "<div 
class=\"histogramConnected\" style=\"height: " + 
fix3pctUS.format(histogramPercent) + "; width: 100%;\">\u00a0</div>");
                }
        }



Reply via email to