forked from I2P_Developers/i2p.i2p
give the reliability more positive influence so it doesn't go negative so easily
update the peerProfile's CLI to make the resulting stats easier to read
This commit is contained in:
@@ -2,6 +2,8 @@ package net.i2p.router.peermanager;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.router.RouterContext;
|
||||
import net.i2p.stat.RateStat;
|
||||
@@ -297,6 +299,8 @@ public class PeerProfile {
|
||||
*/
|
||||
public static void main(String args[]) {
|
||||
RouterContext ctx = new RouterContext(new net.i2p.router.Router());
|
||||
DecimalFormat fmt = new DecimalFormat("0,000.0");
|
||||
fmt.setPositivePrefix("+");
|
||||
ProfilePersistenceHelper helper = new ProfilePersistenceHelper(ctx);
|
||||
try { Thread.sleep(5*1000); } catch (InterruptedException e) {}
|
||||
StringBuffer buf = new StringBuffer(1024);
|
||||
@@ -308,9 +312,9 @@ public class PeerProfile {
|
||||
}
|
||||
//profile.coallesceStats();
|
||||
buf.append("Peer " + profile.getPeer().toBase64()
|
||||
+ ":\t Speed:\t" + profile.calculateSpeed()
|
||||
+ " Reliability:\t" + profile.calculateReliability()
|
||||
+ " Integration:\t" + profile.calculateIntegration()
|
||||
+ ":\t Speed:\t" + fmt.format(profile.calculateSpeed())
|
||||
+ " Reliability:\t" + fmt.format(profile.calculateReliability())
|
||||
+ " Integration:\t" + fmt.format(profile.calculateIntegration())
|
||||
+ " Active?\t" + profile.getIsActive()
|
||||
+ " Failing?\t" + profile.calculateIsFailing()
|
||||
+ '\n');
|
||||
|
@@ -23,10 +23,10 @@ public class ReliabilityCalculator extends Calculator {
|
||||
return profile.getReliabilityBonus();
|
||||
|
||||
long val = 0;
|
||||
val += profile.getSendSuccessSize().getRate(60*1000).getCurrentEventCount() * 5;
|
||||
val += profile.getSendSuccessSize().getRate(60*1000).getLastEventCount() * 2;
|
||||
val += profile.getSendSuccessSize().getRate(60*60*1000).getLastEventCount();
|
||||
val += profile.getSendSuccessSize().getRate(60*60*1000).getCurrentEventCount();
|
||||
val += profile.getSendSuccessSize().getRate(60*1000).getCurrentEventCount() * 20;
|
||||
val += profile.getSendSuccessSize().getRate(60*1000).getLastEventCount() * 10;
|
||||
val += profile.getSendSuccessSize().getRate(60*60*1000).getLastEventCount() * 1;
|
||||
val += profile.getSendSuccessSize().getRate(60*60*1000).getCurrentEventCount() * 5;
|
||||
|
||||
val += profile.getTunnelCreateResponseTime().getRate(10*60*1000).getLastEventCount() * 5;
|
||||
val += profile.getTunnelCreateResponseTime().getRate(60*60*1000).getCurrentEventCount();
|
||||
@@ -36,10 +36,10 @@ public class ReliabilityCalculator extends Calculator {
|
||||
//val -= profile.getSendFailureSize().getRate(60*60*1000).getCurrentEventCount()*2;
|
||||
//val -= profile.getSendFailureSize().getRate(60*60*1000).getLastEventCount()*2;
|
||||
|
||||
val -= profile.getTunnelHistory().getRejectionRate().getRate(60*1000).getCurrentEventCount() * 50;
|
||||
val -= profile.getTunnelHistory().getRejectionRate().getRate(60*1000).getLastEventCount() * 25;
|
||||
val -= profile.getTunnelHistory().getRejectionRate().getRate(60*60*1000).getCurrentEventCount() * 5;
|
||||
val -= profile.getTunnelHistory().getRejectionRate().getRate(60*60*1000).getLastEventCount() * 1;
|
||||
val -= profile.getTunnelHistory().getRejectionRate().getRate(60*1000).getCurrentEventCount() * 10;
|
||||
val -= profile.getTunnelHistory().getRejectionRate().getRate(60*1000).getLastEventCount() * 5;
|
||||
val -= profile.getTunnelHistory().getRejectionRate().getRate(60*60*1000).getCurrentEventCount() * 1;
|
||||
//val -= profile.getTunnelHistory().getRejectionRate().getRate(60*60*1000).getLastEventCount() * 1;
|
||||
|
||||
// penalize them heavily for dropping netDb requests
|
||||
val -= profile.getDBHistory().getFailedLookupRate().getRate(60*1000).getCurrentEventCount() * 10;
|
||||
|
Reference in New Issue
Block a user