2006-04-14 jrandom

* Make some more stats graphable, and allow some internal tweaking on the
      tunnel pairing for creation and testing.
This commit is contained in:
jrandom
2006-04-14 11:40:35 +00:00
committed by zzz
parent 230d4cd23f
commit 8d0a9b4ccd
5 changed files with 22 additions and 11 deletions

View File

@ -1,4 +1,8 @@
$Id: history.txt,v 1.454 2006/04/12 23:22:07 jrandom Exp $
$Id: history.txt,v 1.455 2006/04/13 07:40:21 jrandom Exp $
2006-04-14 jrandom
* Make some more stats graphable, and allow some internal tweaking on the
tunnel pairing for creation and testing.
* 2006-04-13 0.6.1.15 released

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.394 $ $Date: 2006/04/12 23:22:33 $";
public final static String ID = "$Revision: 1.395 $ $Date: 2006/04/13 07:40:22 $";
public final static String VERSION = "0.6.1.15";
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);

View File

@ -62,10 +62,10 @@ public class EstablishmentManager {
_queuedOutbound = new HashMap(32);
_liveIntroductions = new HashMap(32);
_activityLock = new Object();
_context.statManager().createRateStat("udp.inboundEstablishTime", "How long it takes for a new inbound session to be established", "udp", new long[] { 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.outboundEstablishTime", "How long it takes for a new outbound session to be established", "udp", new long[] { 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.inboundEstablishFailedState", "What state a failed inbound establishment request fails in", "udp", new long[] { 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.outboundEstablishFailedState", "What state a failed outbound establishment request fails in", "udp", new long[] { 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.inboundEstablishTime", "How long it takes for a new inbound session to be established", "udp", new long[] { 60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.outboundEstablishTime", "How long it takes for a new outbound session to be established", "udp", new long[] { 60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.inboundEstablishFailedState", "What state a failed inbound establishment request fails in", "udp", new long[] { 60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.outboundEstablishFailedState", "What state a failed outbound establishment request fails in", "udp", new long[] { 60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.sendIntroRelayRequest", "How often we send a relay request to reach a peer", "udp", new long[] { 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.sendIntroRelayTimeout", "How often a relay request times out before getting a response (due to the target or intro peer being offline)", "udp", new long[] { 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.receiveIntroRelayResponse", "How long it took to receive a relay response", "udp", new long[] { 60*60*1000, 24*60*60*1000 });

View File

@ -154,7 +154,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
_context.statManager().createRateStat("udp.alreadyConnected", "What is the lifetime of a reestablished session", "udp", new long[] { 60*1000, 10*60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.droppedPeer", "How long ago did we receive from a dropped peer (duration == session lifetime", "udp", new long[] { 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.droppedPeerInactive", "How long ago did we receive from a dropped peer (duration == session lifetime)", "udp", new long[] { 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.droppedPeerInactive", "How long ago did we receive from a dropped peer (duration == session lifetime)", "udp", new long[] { 60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.statusOK", "How many times the peer test returned OK", "udp", new long[] { 5*60*1000, 20*60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.statusDifferent", "How many times the peer test returned different IP/ports", "udp", new long[] { 5*60*1000, 20*60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.statusReject", "How many times the peer test returned reject unsolicited", "udp", new long[] { 5*60*1000, 20*60*1000, 60*60*1000, 24*60*60*1000 });

View File

@ -21,10 +21,17 @@ class BuildRequestor {
for (int i = 0; i < BuildMessageGenerator.ORDER.length; i++)
ORDER.add(new Integer(i));
}
private static final boolean USE_PAIRED_CLIENT_TUNNELS = true;
private static final int PRIORITY = 500;
static final int REQUEST_TIMEOUT = 20*1000;
private static boolean usePairedTunnels(RouterContext ctx) {
String val = ctx.getProperty("router.usePairedTunnels");
if ( (val == null) || (Boolean.valueOf(val).booleanValue()) )
return true;
else
return false;
}
/** new style requests need to fill in the tunnel IDs before hand */
public static void prepare(RouterContext ctx, PooledTunnelCreatorConfig cfg) {
for (int i = 0; i < cfg.getLength(); i++) {
@ -58,7 +65,7 @@ class BuildRequestor {
cfg.setTunnelPool(pool);
TunnelInfo pairedTunnel = null;
if (pool.getSettings().isExploratory() || !USE_PAIRED_CLIENT_TUNNELS) {
if (pool.getSettings().isExploratory() || !usePairedTunnels(ctx)) {
if (pool.getSettings().isInbound())
pairedTunnel = ctx.tunnelManager().selectOutboundTunnel();
else
@ -72,7 +79,7 @@ class BuildRequestor {
if (pairedTunnel == null) {
if (log.shouldLog(Log.WARN))
log.warn("Couldn't find a paired tunnel for " + cfg + ", fall back on exploratory tunnels for pairing");
if (!pool.getSettings().isExploratory() && USE_PAIRED_CLIENT_TUNNELS)
if (!pool.getSettings().isExploratory() && usePairedTunnels(ctx))
if (pool.getSettings().isInbound())
pairedTunnel = ctx.tunnelManager().selectOutboundTunnel();
else