Author: zothar
Date: 2007-04-13 23:24:30 +0000 (Fri, 13 Apr 2007)
New Revision: 12672

Modified:
   trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
Log:
Move the Thread usage box to the third column of the stats page and show more 
stats even when we don't have peers connected currently.

Modified: trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java       
2007-04-13 22:04:55 UTC (rev 12671)
+++ trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java       
2007-04-13 23:24:30 UTC (rev 12672)
@@ -202,15 +202,6 @@
                                loadStatsList.addChild("li", 
starters.diagnosticThrottlesLine(false));
                                loadStatsList.addChild("li", 
starters.diagnosticThrottlesLine(true));
                        }
-
-                       nextTableCell = overviewTableRow.addChild("td");
-
-                       // thread usage box
-                       HTMLNode threadUsageInfobox = 
nextTableCell.addChild("div", "class", "infobox");
-                       threadUsageInfobox.addChild("div", "class", 
"infobox-header", "Thread usage");
-                       HTMLNode threadUsageContent = 
threadUsageInfobox.addChild("div", "class", "infobox-content");
-                       HTMLNode threadUsageList = 
threadUsageContent.addChild("ul");
-                       getThreadNames(threadUsageList);
                }

                if(numberOfConnected + numberOfRoutingBackedOff > 0) {          
        
@@ -238,54 +229,62 @@
                        HTMLNode bandwidthInfobox = 
nextTableCell.addChild("div", "class", "infobox");

                        drawBandwidthBox(bandwidthInfobox, nodeUptimeSeconds);
+               }

-                       if(advancedModeEnabled) {
+               if(advancedModeEnabled) {

-                               // Peer routing backoff reason box
-                               HTMLNode backoffReasonInfobox = 
nextTableCell.addChild("div", "class", "infobox");
-                               backoffReasonInfobox.addChild("div", "class", 
"infobox-header", "Peer backoff reasons");
-                               HTMLNode backoffReasonContent = 
backoffReasonInfobox.addChild("div", "class", "infobox-content");
-                               String [] routingBackoffReasons = 
peers.getPeerNodeRoutingBackoffReasons();
-                               if(routingBackoffReasons.length == 0) {
-                                       backoffReasonContent.addChild("#", 
"Good, your node is not backed off from any peers!");
-                               } else {
-                                       HTMLNode reasonList = 
backoffReasonContent.addChild("ul");
-                                       for(int 
i=0;i<routingBackoffReasons.length;i++) {
-                                               int reasonCount = 
peers.getPeerNodeRoutingBackoffReasonSize(routingBackoffReasons[i]);
-                                               if(reasonCount > 0) {
-                                                       
reasonList.addChild("li", routingBackoffReasons[i] + '\u00a0' + reasonCount);
-                                               }
+                       // Peer routing backoff reason box
+                       HTMLNode backoffReasonInfobox = 
nextTableCell.addChild("div", "class", "infobox");
+                       backoffReasonInfobox.addChild("div", "class", 
"infobox-header", "Peer backoff reasons");
+                       HTMLNode backoffReasonContent = 
backoffReasonInfobox.addChild("div", "class", "infobox-content");
+                       String [] routingBackoffReasons = 
peers.getPeerNodeRoutingBackoffReasons();
+                       if(routingBackoffReasons.length == 0) {
+                               backoffReasonContent.addChild("#", "Good, your 
node is not backed off from any peers!");
+                       } else {
+                               HTMLNode reasonList = 
backoffReasonContent.addChild("ul");
+                               for(int i=0;i<routingBackoffReasons.length;i++) 
{
+                                       int reasonCount = 
peers.getPeerNodeRoutingBackoffReasonSize(routingBackoffReasons[i]);
+                                       if(reasonCount > 0) {
+                                               reasonList.addChild("li", 
routingBackoffReasons[i] + '\u00a0' + reasonCount);
                                        }
                                }
+                       }

-                               //Swap statistics box
-                               HTMLNode locationSwapInfobox = 
nextTableCell.addChild("div", "class", "infobox");
-                               drawSwapStatsBox(locationSwapInfobox, 
nodeUptimeSeconds, swaps, noSwaps);
+                       //Swap statistics box
+                       HTMLNode locationSwapInfobox = 
nextTableCell.addChild("div", "class", "infobox");
+                       drawSwapStatsBox(locationSwapInfobox, 
nodeUptimeSeconds, swaps, noSwaps);

-                               // unclaimedFIFOMessageCounts box
-                               HTMLNode unclaimedFIFOMessageCountsInfobox = 
nextTableCell.addChild("div", "class", "infobox");
-                               
drawUnclaimedFIFOMessageCountsBox(unclaimedFIFOMessageCountsInfobox);
+                       // unclaimedFIFOMessageCounts box
+                       HTMLNode unclaimedFIFOMessageCountsInfobox = 
nextTableCell.addChild("div", "class", "infobox");
+                       
drawUnclaimedFIFOMessageCountsBox(unclaimedFIFOMessageCountsInfobox);

-                               // peer distribution box
-                               overviewTableRow = overviewTable.addChild("tr");
-                               nextTableCell = overviewTableRow.addChild("td", 
"class", "first");
-                               HTMLNode peerCircleInfobox = 
nextTableCell.addChild("div", "class", "infobox");
-                               peerCircleInfobox.addChild("div", "class", 
"infobox-header", "Peer\u00a0Location\u00a0Distribution (w/pReject)");
-                               HTMLNode peerCircleTable = 
peerCircleInfobox.addChild("table");
-                               addPeerCircle(peerCircleTable);
-                               nextTableCell = overviewTableRow.addChild("td");
+                       nextTableCell = overviewTableRow.addChild("td");

-                               // node distribution box
-                               HTMLNode nodeCircleInfobox = 
nextTableCell.addChild("div", "class", "infobox");
-                               nodeCircleInfobox.addChild("div", "class", 
"infobox-header", "Node\u00a0Location\u00a0Distribution (w/Swap\u00a0Age)");
-                               HTMLNode nodeCircleTable = 
nodeCircleInfobox.addChild("table");
-                               addNodeCircle(nodeCircleTable);
-                               
-                               // rejection reasons box
-                               HTMLNode rejectReasonsInfobox = 
nextTableCell.addChild("div", "class", "infobox");
-                               drawRejectReasonsBox(rejectReasonsInfobox);
-                               
-                       }
+                       // thread usage box
+                       HTMLNode threadUsageInfobox = 
nextTableCell.addChild("div", "class", "infobox");
+                       threadUsageInfobox.addChild("div", "class", 
"infobox-header", "Thread usage");
+                       HTMLNode threadUsageContent = 
threadUsageInfobox.addChild("div", "class", "infobox-content");
+                       HTMLNode threadUsageList = 
threadUsageContent.addChild("ul");
+                       getThreadNames(threadUsageList);
+                       
+                       // rejection reasons box
+                       HTMLNode rejectReasonsInfobox = 
nextTableCell.addChild("div", "class", "infobox");
+                       drawRejectReasonsBox(rejectReasonsInfobox);
+
+                       // peer distribution box
+                       overviewTableRow = overviewTable.addChild("tr");
+                       nextTableCell = overviewTableRow.addChild("td", 
"class", "first");
+                       HTMLNode peerCircleInfobox = 
nextTableCell.addChild("div", "class", "infobox");
+                       peerCircleInfobox.addChild("div", "class", 
"infobox-header", "Peer\u00a0Location\u00a0Distribution (w/pReject)");
+                       HTMLNode peerCircleTable = 
peerCircleInfobox.addChild("table");
+                       addPeerCircle(peerCircleTable);
+                       nextTableCell = overviewTableRow.addChild("td");
+
+                       // node distribution box
+                       HTMLNode nodeCircleInfobox = 
nextTableCell.addChild("div", "class", "infobox");
+                       nodeCircleInfobox.addChild("div", "class", 
"infobox-header", "Node\u00a0Location\u00a0Distribution (w/Swap\u00a0Age)");
+                       HTMLNode nodeCircleTable = 
nodeCircleInfobox.addChild("table");
+                       addNodeCircle(nodeCircleTable);
                }

                this.writeReply(ctx, 200, "text/html", "OK", 
pageNode.generate());


Reply via email to