From ead39cc87e42a8468816130e822976fb6bd7e72b Mon Sep 17 00:00:00 2001 From: complication Date: Sun, 29 Oct 2006 19:29:50 +0000 Subject: [PATCH] 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 --- core/java/src/net/i2p/time/Timestamper.java | 2 +- history.txt | 10 +++++- .../src/net/i2p/router/RouterVersion.java | 4 +-- .../transport/CommSystemFacadeImpl.java | 35 ++----------------- 4 files changed, 15 insertions(+), 36 deletions(-) diff --git a/core/java/src/net/i2p/time/Timestamper.java b/core/java/src/net/i2p/time/Timestamper.java index 5a23e90e6..6758ab466 100644 --- a/core/java/src/net/i2p/time/Timestamper.java +++ b/core/java/src/net/i2p/time/Timestamper.java @@ -26,7 +26,7 @@ public class Timestamper implements Runnable { private boolean _initialized; 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; /** how many times do we have to query if we are changing the clock? */ private static final int DEFAULT_CONCURRING_SERVERS = 3; diff --git a/history.txt b/history.txt index 6378d6e03..fdc30c2bb 100644 --- a/history.txt +++ b/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-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 * Removed the status display from the console, as its more confusing than informative (though the content is still displayed in the HTML) diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index e1673adb4..86de6395c 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ 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 long BUILD = 0; + public final static long BUILD = 1; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION + "-" + BUILD); System.out.println("Router ID: " + RouterVersion.ID); diff --git a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java index f802c7e3d..f7bd36a07 100644 --- a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java +++ b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java @@ -59,35 +59,6 @@ public class CommSystemFacadeImpl extends CommSystemFacade { public int countActivePeers() { return (_manager == null ? 0 : _manager.countActivePeers()); } 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. @@ -105,9 +76,9 @@ public class CommSystemFacadeImpl extends CommSystemFacade { _log.error("Returning null for framed average peer clock skew (no data)!"); return null; } - if (skews.size() < 5) { - if (_log.shouldLog(Log.ERROR)) - _log.error("Returning null for framed average peer clock skew (only " + skews.size() + " peers)!"); + if (skews.size() < 20) { + if (_log.shouldLog(Log.WARN)) + _log.warn("Returning null for framed average peer clock skew (only " + skews.size() + " peers)!"); return null; } // Going to calculate, sort them