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

Modified Files:
        DecayingRunningAverage.java 
Log Message:
Hack to reset bad rtSearchFail averages - this should NOT be merged to 
to stable - edt


Index: DecayingRunningAverage.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/DecayingRunningAverage.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DecayingRunningAverage.java 30 Aug 2003 23:16:52 -0000      1.2
+++ DecayingRunningAverage.java 30 Sep 2003 03:12:27 -0000      1.3
@@ -1,6 +1,7 @@
 package freenet.node.rt;
 
 import freenet.support.DataObject;
+import freenet.Core;
 import java.io.IOException;
 import java.io.DataOutputStream;
 import java.io.DataInputStream;
@@ -17,6 +18,13 @@
        throws IOException {
        this.decayFactor = decayFactor;
        this.currentVal = dis.readDouble();
+       // hack to correct data - to be removed.  edt
+       if(currentVal<0 || currentVal>3600000) {
+           Core.logger.log(this, "reset "+currentVal,
+                new Exception("debug"),
+               Core.logger.NORMAL);
+           currentVal = Core.hopTime(1);
+       }
     }
     
     public final double currentValue() {
@@ -25,7 +33,7 @@
     
     public final void report(double d) {
        currentVal = currentVal * (1-decayFactor) + 
-           d * decayFactor;
+           d * decayFactor; 
     }
     
     public final void report(long d) {
@@ -35,9 +43,7 @@
     public static RunningAverageFactory factory() {
        return new DecayingRunningAverageFactory();
     }
-    
-    
-    
+
     static class DecayingRunningAverageFactory 
        implements RunningAverageFactory {
        double defaultFactor = 0.2;

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

Reply via email to