2006-10-29 Complication
* Ensure we get NTP samples from more diverse sources (0.pool.ntp.org, 1.pool.ntp.org, etc) * Discard median-based peer skew calculator as framed average works, and adjusting its percentage can make it behave median-like * Require more data points (from at least 20 peers) before considering a peer skew measurement reliable
This commit is contained in:
@ -26,7 +26,7 @@ public class Timestamper implements Runnable {
|
|||||||
private boolean _initialized;
|
private boolean _initialized;
|
||||||
|
|
||||||
private static final int DEFAULT_QUERY_FREQUENCY = 5*60*1000;
|
private static final int DEFAULT_QUERY_FREQUENCY = 5*60*1000;
|
||||||
private static final String DEFAULT_SERVER_LIST = "pool.ntp.org, pool.ntp.org, pool.ntp.org";
|
private static final String DEFAULT_SERVER_LIST = "0.pool.ntp.org, 1.pool.ntp.org, 2.pool.ntp.org";
|
||||||
private static final boolean DEFAULT_DISABLED = true;
|
private static final boolean DEFAULT_DISABLED = true;
|
||||||
/** how many times do we have to query if we are changing the clock? */
|
/** how many times do we have to query if we are changing the clock? */
|
||||||
private static final int DEFAULT_CONCURRING_SERVERS = 3;
|
private static final int DEFAULT_CONCURRING_SERVERS = 3;
|
||||||
|
10
history.txt
10
history.txt
@ -1,7 +1,15 @@
|
|||||||
$Id: history.txt,v 1.531 2006-10-08 17:52:59 complication Exp $
|
$Id: history.txt,v 1.532 2006-10-08 20:44:47 jrandom Exp $
|
||||||
|
|
||||||
* 2006-10-10 0.6.1.26 released
|
* 2006-10-10 0.6.1.26 released
|
||||||
|
|
||||||
|
2006-10-29 Complication
|
||||||
|
* Ensure we get NTP samples from more diverse sources
|
||||||
|
(0.pool.ntp.org, 1.pool.ntp.org, etc)
|
||||||
|
* Discard median-based peer skew calculator as framed average works,
|
||||||
|
and adjusting its percentage can make it behave median-like
|
||||||
|
* Require more data points (from at least 20 peers)
|
||||||
|
before considering a peer skew measurement reliable
|
||||||
|
|
||||||
2006-10-10 jrandom
|
2006-10-10 jrandom
|
||||||
* Removed the status display from the console, as its more confusing
|
* Removed the status display from the console, as its more confusing
|
||||||
than informative (though the content is still displayed in the HTML)
|
than informative (though the content is still displayed in the HTML)
|
||||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RouterVersion {
|
public class RouterVersion {
|
||||||
public final static String ID = "$Revision: 1.466 $ $Date: 2006-10-08 17:53:00 $";
|
public final static String ID = "$Revision: 1.467 $ $Date: 2006-10-08 20:45:02 $";
|
||||||
public final static String VERSION = "0.6.1.26";
|
public final static String VERSION = "0.6.1.26";
|
||||||
public final static long BUILD = 0;
|
public final static long BUILD = 1;
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
||||||
System.out.println("Router ID: " + RouterVersion.ID);
|
System.out.println("Router ID: " + RouterVersion.ID);
|
||||||
|
@ -59,35 +59,6 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
|
|||||||
|
|
||||||
public int countActivePeers() { return (_manager == null ? 0 : _manager.countActivePeers()); }
|
public int countActivePeers() { return (_manager == null ? 0 : _manager.countActivePeers()); }
|
||||||
public int countActiveSendPeers() { return (_manager == null ? 0 : _manager.countActiveSendPeers()); }
|
public int countActiveSendPeers() { return (_manager == null ? 0 : _manager.countActiveSendPeers()); }
|
||||||
|
|
||||||
/**
|
|
||||||
* Median clock skew of connected peers in seconds, or null if we cannot answer.
|
|
||||||
*/
|
|
||||||
public Long getMedianPeerClockSkew() {
|
|
||||||
if (_manager == null) {
|
|
||||||
if (_log.shouldLog(Log.INFO))
|
|
||||||
_log.info("Returning null for median peer clock skew (no transport manager)!");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Vector skews = _manager.getClockSkews();
|
|
||||||
if (skews == null) {
|
|
||||||
if (_log.shouldLog(Log.ERROR))
|
|
||||||
_log.error("Returning null for median peer clock skew (no data)!");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (skews.size() < 5) {
|
|
||||||
if (_log.shouldLog(Log.ERROR))
|
|
||||||
_log.error("Returning null for median peer clock skew (only " + skews.size() + " peers)!");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// Going to calculate, let's sort them
|
|
||||||
Collections.sort(skews);
|
|
||||||
// Pick out median
|
|
||||||
Long medianPeerClockSkew = (Long) (skews.get(skews.size() / 2));
|
|
||||||
if (_log.shouldLog(Log.INFO))
|
|
||||||
_log.info("Our median peer clock skew is " + medianPeerClockSkew + " s.");
|
|
||||||
return medianPeerClockSkew;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Framed average clock skew of connected peers in seconds, or null if we cannot answer.
|
* Framed average clock skew of connected peers in seconds, or null if we cannot answer.
|
||||||
@ -105,9 +76,9 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
|
|||||||
_log.error("Returning null for framed average peer clock skew (no data)!");
|
_log.error("Returning null for framed average peer clock skew (no data)!");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (skews.size() < 5) {
|
if (skews.size() < 20) {
|
||||||
if (_log.shouldLog(Log.ERROR))
|
if (_log.shouldLog(Log.WARN))
|
||||||
_log.error("Returning null for framed average peer clock skew (only " + skews.size() + " peers)!");
|
_log.warn("Returning null for framed average peer clock skew (only " + skews.size() + " peers)!");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// Going to calculate, sort them
|
// Going to calculate, sort them
|
||||||
|
Reference in New Issue
Block a user