* for the moment, remove the 'isFailing' check for peers who have failing tunnels

(we need a more sophisticated algorithm than the one in place for it to be effective)
* fix for the profileOrganizer to work safely in the sim
This commit is contained in:
jrandom
2004-07-25 23:46:55 +00:00
committed by zzz
parent 43c18d0f4d
commit edaf7aee5d
2 changed files with 15 additions and 9 deletions

View File

@ -54,13 +54,19 @@ public class IsFailingCalculator extends Calculator {
return true;
}
Rate failedRate = profile.getTunnelHistory().getFailedRate().getRate(60*1000);
if (failedRate.getCurrentEventCount() >= 2) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Peer " + profile.getPeer().toBase64()
+ " is failing because too many of their tunnels failed recently");
return true;
}
////
// the right way to behave would be to use some statistical
// analysis on the failure rate, and only mark the peer as failing
// if their rate exceeded the expected rate (mean, median, stddev, etc)
////
//Rate failedRate = profile.getTunnelHistory().getFailedRate().getRate(60*1000);
//if (failedRate.getCurrentEventCount() >= 2) {
// if (_log.shouldLog(Log.DEBUG))
// _log.debug("Peer " + profile.getPeer().toBase64()
// + " is failing because too many of their tunnels failed recently");
// return true;
//}
return false;
}

View File

@ -146,8 +146,8 @@ public class ProfileOrganizer {
* Add the new profile, returning the old value (or null if no profile existed)
*
*/
public PeerProfile addProfile(PeerProfile profile) {
if ( (profile == null) || (profile.getPeer() == null) || (_us.equals(profile.getPeer())) ) return null;
public PeerProfile addProfile(PeerProfile profile) throws IllegalStateException {
if ( (profile == null) || (profile.getPeer() == null) ) return null;
if (_log.shouldLog(Log.DEBUG))
_log.debug("New profile created for " + profile.getPeer().toBase64());