Update of /cvsroot/freenet/freenet/src/freenet/node/states/announcing
In directory sc8-pr-cvs1:/tmp/cvs-serv20832/freenet/src/freenet/node/states/announcing

Modified Files:
        Announcing.java 
Log Message:
Make queriesPerHour a time weighted decaying average.
Set lsHalfLifeHours=0 for previous behavior.

Print the local port number together with peer IP
in order to correlate with netstat output, both
in logs and on "Open Connections" servlet.

Version.java 
(Version) buildNumber = 6216

tcpConnection.java   Add import freenet.node.Node;
(tcpConnection.toString)
  Compare sock.getLocalPort to Node.listenport.
  Add import freenet.node.Node;
  If not equal, prepend localPort+">" to IP number of peer.
  If equal, append ">local" to IP number of peer.

Node.java Add new configuration option, lsHalfLifeHours
(Node.static) add description strings, default value 0.5
(Node) static public double lsHalfLifeHours;
(Node.init) lsHalfLifeHours = params.getDouble("lsHalfLifeHours");

Main.java
(Main.main) Pass Node.lsHalfLifeHours to new LoadStats()

LoadStats.java
(LoadStats) new field queriesPerHour
(LoadStats.LoadStats) accept lsHalfLifeHours parameter,
  queriesPerHour = new DecayingTimeWeightedAverage()
  specifying time unit of one hour and half life
  from the parameter.
(receivedQuery) move call to System.currentTimeMillis()
  out of synchronized(timesLock).  Once every times.length
  calls, call localQueryTraffic() to compute average.
(localQueryTraffic) Note current time upon entry.
  Always make an estimate, even when fewer than
  lsAcceptRatioSamples queries have been received.
  Return the decaying time weighted average of
  events per hour, instead of the instanteous value.
(DecayingTimeWeightedAverage) New private class,
  with method average(now, start, events)
  calculates average events per unit time, decaying
  with half-life specified in constructor.  
  If value was A events/hour, and subsequent
  calls submit B events/hour, after one half-life,
  the average will be (A+B)/2, and after two,
  the average will be (A+3B)/2.  Exponential decay.
  Probably should be moved into utilities...

Announcing.java  fixed typo in a comment.

OpenConnectionManager.java
  Change "Connections transferring (Receiving/Transmitting)"
  to "(Transmitting/Receiving)"
  Fix some comments.  Indentation.
  Append ch.getLocalPort() to the inbound/outbound 
  sending/receiving/both indicator.  Should add a new column.


ConnectionHandler.java
(getLocalPort) new method returns conn.getSocket().getLocalPort()
  or zero if any returned null.



Index: Announcing.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/states/announcing/Announcing.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- Announcing.java     30 Aug 2003 23:16:53 -0000      1.33
+++ Announcing.java     3 Oct 2003 08:35:20 -0000       1.34
@@ -18,7 +18,7 @@
 
     static long startTime = -1;
     /**
-     * Places the Announcing state in the nodes state table, where it will
+     * Places the Announcing state in the node's state table, where it will
      * live.
      * @param n               The node to announce.
      * @param hopsToLive      HopsToLive to use on each message

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

Reply via email to