Update of /cvsroot/freenet/freenet/src/freenet/client/http
In directory sc8-pr-cvs1:/tmp/cvs-serv30848/src/freenet/client/http

Modified Files:
        NodeStatusServlet.java 
Log Message:
Display microscopic images of estimate() values-over-keyspace for each node in the RT 
on '/servlet/nodestatus/nodestatus.html'

Index: NodeStatusServlet.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/http/NodeStatusServlet.java,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -w -r1.83 -r1.84
--- NodeStatusServlet.java      13 Nov 2003 02:16:59 -0000      1.83
+++ NodeStatusServlet.java      13 Nov 2003 12:02:52 -0000      1.84
@@ -40,6 +40,7 @@
 import freenet.node.ds.FSDataStore;
 import freenet.node.rt.CPAlgoRoutingTable;
 import freenet.node.rt.NGRoutingTable;
+import freenet.node.rt.NodeEstimator;
 import freenet.node.rt.RTDiagSnapshot;
 import freenet.node.rt.RoutingTable;
 import freenet.node.rt.TimeEstimator;
@@ -1111,10 +1112,6 @@
         RoutingTable rt = Main.origRT;
         if(rt instanceof NGRoutingTable) {
             NGRoutingTable ngrt = (NGRoutingTable)rt;
-            String graph = req.getParameter("estimator");
-            if(graph == null)
-                resp.sendError(404, "No graph name specified");
-            TimeEstimator e = ngrt.getEstimator(i, graph);
             int width = 640;
             String pwidth = req.getParameter("width");
             if(pwidth != null) {
@@ -1133,6 +1130,20 @@
                     height = 480;
                 }
             }
+            String graph = req.getParameter("estimator");
+            if(graph == null)
+                resp.sendError(404, "No graph name specified");
+            if(graph.equalsIgnoreCase("composite")){
+               NodeEstimator e =  ngrt.getEstimator(i);
+               if(e== null)
+                       resp.sendError(404, "Invalid identity '"+i+"' specified");
+               else{
+                                       resp.setContentType("image/bmp");
+                       
e.getHTMLReportingTool().drawCombinedGraphBMP(width,height,resp.getOutputStream());
+               }
+            }else{
+            TimeEstimator e = ngrt.getEstimator(i, graph);
+
             String clip = req.getParameter("clippoints");
             boolean clippoints = false;
             if(clip != null && 
@@ -1140,6 +1151,7 @@
                 clippoints = true;
             resp.setContentType("image/bmp");
             e.getHTMLReportingTool().drawGraphBMP(width, height, !clippoints, 
resp.getOutputStream());
+            }
         } else {
             resp.sendError(404, "Not an NGRoutingTable");
         }
@@ -1845,14 +1857,14 @@
         boolean failing = true;
         boolean isCPRT = rtType.equals("freenet.node.rt.CPAlgoRoutingTable");
         boolean isNGRT = rtType.equals("freenet.node.rt.NGRoutingTable");
-        int ngrtadd = isNGRT?1:0;
+        int ngrtadd = isNGRT?2:0;
         NodeReference ref = null;
         if (isCPRT || isNGRT) {
             if (refValues[2+ngrtadd].equals(ZERO)) {
                 refValues[2+ngrtadd] = "none";
                 failing = false;
             }
-            colJoin = isCPRT ? 12 : 15;
+            colJoin = isCPRT ? 12 : 16;
             refValues[colJoin] = refValues[colJoin].toString() + "/" + 
                 refValues[colJoin+1];
             if(refValues[colJoin].equals("0/0")) {
@@ -1927,13 +1939,19 @@
                 refValues[9] = "<a href=\"/"+refValues[11]+"\">" + refValues[9] + 
"</a>";
             }
         } else if(isNGRT) {
-            ref = (NodeReference)refValues[10];
+            ref = (NodeReference)refValues[11];
             refValues[1] = refValues[1].toString() + "ms";
-            refValues[8] = refValues[8].toString() + "ms";
+                       refValues[3] = "<IMG SRC=\"nodeGraph.bmp?identity="+
+                                       
((DSAIdentity)(ref.getIdentity())).getYAsHexString()+
+                                       "&estimator=composite&width=60&height=20\">";
+                       refValues[7] = ((String)refValues[7]).replaceAll(" ","&nbsp;");
             refValues[9] = refValues[9].toString() + "ms";
+            refValues[10] = refValues[10].toString() + "ms";
             refValues[0] = "<a href=\"nodeDetails.html?identity="+
                 ((DSAIdentity)(ref.getIdentity())).getYAsHexString()+
                 "\">"+refValues[0]+"</a>";
+                       refValues[18] = ((String)refValues[18]).replaceAll(" 
","&nbsp;");
+                       refValues[19] = ((String)refValues[19]).replaceAll(" 
","&nbsp;");
         }
         
 //        // WTF?

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to