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

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

Index: StandardNodeEstimator.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/StandardNodeEstimator.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -w -r1.34 -r1.35
--- StandardNodeEstimator.java  13 Nov 2003 02:16:58 -0000      1.34
+++ StandardNodeEstimator.java  13 Nov 2003 12:02:51 -0000      1.35
@@ -5,6 +5,7 @@
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
+import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.math.BigInteger;
 import java.util.Hashtable;
@@ -21,7 +22,9 @@
 import freenet.support.Logger;
 import freenet.support.SimpleStringMap;
 import freenet.support.graph.Bitmap;
+import freenet.support.graph.BitmapEncoder;
 import freenet.support.graph.Color;
+import freenet.support.graph.DibEncoder;
 import freenet.support.io.WriteOutputStream;
 
 class StandardNodeEstimator extends NodeEstimator {
@@ -459,7 +462,7 @@
        }
        
        private final static String[] REF_PROPERTIES =
-       { "Address", "Last Estimate", "Connection Probability", 
+       { "Address", "Last Estimate", "Connection Probability","Estimate graph", 
          "Consecutive Failures", "Connection Attempts", "Successful Connections", 
          "Last Attempt", "Successful Transfers", "Connection Fail Time",
          "Connection Success Time", "NodeReference", "Node Version", 
@@ -490,14 +493,14 @@
                }
                
                protected int openConnections() {
-                       Integer outboundConnections = (Integer)objs[15];
-                       Integer inboundConnections = (Integer)objs[16];
+                       Integer outboundConnections = (Integer)objs[16];
+                       Integer inboundConnections = (Integer)objs[17];
                        return outboundConnections.intValue() +
                                inboundConnections.intValue();
                }
                
                protected int successes() {
-                       Integer successes = (Integer)objs[7];
+                       Integer successes = (Integer)objs[8];
                        return successes.intValue();
                }
                
@@ -513,30 +516,29 @@
                values[0] = ref.firstPhysicalToString();
                values[1] = new Long(lastEstimate);
                values[2] = new Float(1.0 - rpConnectFailed.currentValue());
-               values[3] = new Long(consecutiveFailedConnects);
-               values[4] = new Long(connectTries);
-               values[5] = new Long(connectSuccesses);
+               values[3] = "Estimate graph";
+               values[4] = new Long(consecutiveFailedConnects);
+               values[5] = new Long(connectTries);
+               values[6] = new Long(connectSuccesses);
                long now = System.currentTimeMillis();
                long secsSinceLastAttempt = -1;
                if(connectTries > 0) {
                        secsSinceLastAttempt = (now - lastConnectTryTime) / 1000;
                }
-               values[6] = new Long(secsSinceLastAttempt);
-               values[7] = new Integer(successes);
-               values[8] = new Integer((int)rtConnectFailed.currentValue());
-               values[9] = new Integer((int)rtConnected.currentValue());
-               values[10] = ref;
-               values[11] = ref.getVersion();
-               values[12] = new Float(rpSearchFailed.currentValue());
-               values[13] = new Float(rpTransferFailed.currentValue());
-               values[14] = new Float(rtSearchFailed.currentValue());
-               values[15] = 
-                       new Integer(ngrt.countOutboundConnections(ref.getIdentity()));
-               values[16] = 
-                       new Integer(ngrt.countInboundConnections(ref.getIdentity()));
+               values[7] = new Long(secsSinceLastAttempt);
+               values[8] = new Integer(successes);
+               values[9] = new Integer((int)rtConnectFailed.currentValue());
+               values[10] = new Integer((int)rtConnected.currentValue());
+               values[11] = ref;
+               values[12] = ref.getVersion();
+               values[13] = new Float(rpSearchFailed.currentValue());
+               values[14] = new Float(rpTransferFailed.currentValue());
+               values[15] = new Float(rtSearchFailed.currentValue());
+               values[16] = new 
Integer(ngrt.countOutboundConnections(ref.getIdentity()));
+               values[17] = new 
Integer(ngrt.countInboundConnections(ref.getIdentity()));
                TimeEstimator.HTMLReportTool reportTool = 
etTransferRate.getHTMLReportingTool();
-               values[17] = reportTool.lowestString(TimeEstimator.TRANSFER_RATE);
-               values[18] = reportTool.highestString(TimeEstimator.TRANSFER_RATE);
+               values[18] = reportTool.lowestString(TimeEstimator.TRANSFER_RATE);
+               values[19] = reportTool.highestString(TimeEstimator.TRANSFER_RATE);
                return new MyComparableStringMap(values);
        }
        
@@ -781,6 +783,15 @@
                                }
                        }
                        return retval;
+               }
+               
+               public void drawCombinedGraphBMP(int width,int height,OutputStream o) 
throws IOException{
+                       Bitmap bmp = new Bitmap(width, height);
+                       drawCombinedGraph(bmp,0,new Color(0, 0, 0));
+                       BitmapEncoder enc = new DibEncoder();
+                       enc.setBitmap(bmp);
+                       enc.encode(o);
+                       o.close();
                }
 
                private GraphDataSet generateGraphData(int samples,BigInteger 
keyspaceStepLength,int htl, long size,double pLegitDNF){

Index: NodeEstimator.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/NodeEstimator.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -r1.15 -r1.16
--- NodeEstimator.java  13 Nov 2003 02:16:58 -0000      1.15
+++ NodeEstimator.java  13 Nov 2003 12:02:52 -0000      1.16
@@ -2,6 +2,7 @@
 package freenet.node.rt;
 
 import java.io.IOException;
+import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.util.Hashtable;
 
@@ -110,6 +111,7 @@
                **/
                public void drapGraphOnImage(boolean dontClipPoints, Bitmap 
bmp,boolean drawHistoryIfPresent,int drawMode,Hashtable lineColors);
                lowestHighestPair drawCombinedGraph(Bitmap bmp, int drawMode, Color c);
+               public void drawCombinedGraphBMP(int width,int height,OutputStream o) 
throws IOException;
        }
        /**
         * @return peak successful search time

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

Reply via email to