propagate from branch 'i2p.i2p.zzz.test3' (head 1f086d33dd3479afceb025d2da7956d7470fb3e5)

to branch 'i2p.i2p' (head 6959293ce260b9da4d61776717c02e20a0c7b2dd)
This commit is contained in:
zzz
2009-08-07 18:30:04 +00:00
51 changed files with 1229 additions and 453 deletions

View File

@ -767,10 +767,10 @@ public class Blocklist {
out.write("</table>");
}
if (_blocklistSize > 0) {
out.write("<table><tr><td align=center colspan=2><b>IPs from Blocklist File</b></td></tr><tr><td align=center><b>From</b></td><td align=center><b>To</b></td></tr>");
out.write("<table><tr><th align=center colspan=2><b>IPs from Blocklist File</b></th></tr><tr><td align=center width=50%><b>From:</b></td><td align=center width=50%><b>To:</b></td></tr>");
for (int i = 0; i < _blocklistSize; i++) {
int from = getFrom(_blocklist[i]);
out.write("<tr><td align=right>"); out.write(toStr(from)); out.write("</td><td align=right>");
out.write("<tr><td align=center width=50%>"); out.write(toStr(from)); out.write("</td><td align=center width=50%>");
int to = getTo(_blocklist[i]);
if (to != from) {
out.write(toStr(to)); out.write("</td></tr>\n");
@ -779,7 +779,7 @@ public class Blocklist {
}
out.write("</table>");
} else {
out.write("<br>No blocklist file entries");
out.write("<br><i>No blocklist file entries.</i>");
}
out.flush();
}

View File

@ -607,7 +607,7 @@ public class JobQueue {
out.flush();
StringBuilder buf = new StringBuilder(32*1024);
buf.append("<b><div class=\"joblog\"><h3>I2P JobQueue</h3># runners: ").append(numRunners).append(" [states=");
buf.append("<b><div class=\"joblog\"><h3>I2P JobQueue</h3><div class=\"wideload\"># runners: ").append(numRunners).append(" [states=");
if (states != null)
for (int i = 0; i < states.length; i++)
buf.append(states[i]).append(" ");
@ -667,7 +667,7 @@ public class JobQueue {
/** render the HTML for the job stats */
private void getJobStats(StringBuilder buf) {
buf.append("<table border=\"1\">\n");
buf.append("<table>\n");
buf.append("<tr><th>Job</th><th>Runs</th>");
buf.append("<th>Time</th><th><i>Avg</i></th><th><i>Max</i></th><th><i>Min</i></th>");
buf.append("<th>Pending</th><th><i>Avg</i></th><th><i>Max</i></th><th><i>Min</i></th></tr>\n");
@ -734,6 +734,6 @@ public class JobQueue {
buf.append("<td><i>").append(minPendingTime).append("</i></td>");
buf.append("</tr>\n");
buf.append("</table>\n");
buf.append("</table></div>\n");
}
}

View File

@ -67,7 +67,7 @@ public class PersistentKeyRing extends KeyRing {
@Override
public void renderStatusHTML(Writer out) throws IOException {
StringBuilder buf = new StringBuilder(1024);
buf.append("\n<table border=\"1\"><tr><th align=\"left\">Destination Hash<th align=\"left\">Name or Dest.<th align=\"left\">Session Key</tr>");
buf.append("\n<table><tr><th align=\"left\">Destination Hash<th align=\"left\">Name or Dest.<th align=\"left\">Session Key</tr>");
for (Entry<Hash, SessionKey> e : entrySet()) {
buf.append("\n<tr><td>");
Hash h = e.getKey();

View File

@ -759,7 +759,7 @@ public class Router {
buf.setLength(0);
buf.append("\n<hr /><a name=\"logs\"> </a>\n");
List msgs = _context.logManager().getBuffer().getMostRecentMessages();
buf.append("\n<h2>Most recent console messages:</h2><table border=\"1\">\n");
buf.append("\n<h2>Most recent console messages:</h2><table>\n");
for (Iterator iter = msgs.iterator(); iter.hasNext(); ) {
String msg = (String)iter.next();
buf.append("<tr><td align=\"left\"><pre>");

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 0;
public final static long BUILD = 07;
/** for example "-test" */
public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;

View File

@ -218,7 +218,11 @@ class ProfileOrganizerRenderer {
}
buf.append("</table>");
buf.append("<p><i>Definitions:<ul>");
buf.append("<h3>Thresholds:</h3>");
buf.append("<b>Speed:</b> ").append(num(_organizer.getSpeedThreshold())).append(" (").append(fast).append(" fast peers)<br />");
buf.append("<b>Capacity:</b> ").append(num(_organizer.getCapacityThreshold())).append(" (").append(reliable).append(" high capacity peers)<br />");
buf.append("<b>Integration:</b> ").append(num(_organizer.getIntegrationThreshold())).append(" (").append(integrated).append(" well integrated peers)");
buf.append("<h3>Definitions:</h3><ul>");
buf.append("<li><b>groups</b>: as determined by the profile organizer</li>");
buf.append("<li><b>caps</b>: capabilities in the netDb, not used to determine profiles</li>");
buf.append("<li><b>speed</b>: peak throughput (bytes per second) over a 1 minute period that the peer has sustained in a single tunnel</li>");
@ -226,10 +230,6 @@ class ProfileOrganizerRenderer {
buf.append("<li><b>integration</b>: how many new peers have they told us about lately?</li>");
buf.append("<li><b>failing?</b>: is the peer currently swamped (and if possible we should avoid nagging them)?</li>");
buf.append("</ul></i>");
buf.append("<p><b>Thresholds:</b><br />");
buf.append("<b>Speed:</b> ").append(num(_organizer.getSpeedThreshold())).append(" (").append(fast).append(" fast peers)<br />");
buf.append("<b>Capacity:</b> ").append(num(_organizer.getCapacityThreshold())).append(" (").append(reliable).append(" high capacity peers)<br />");
buf.append("<b>Integration:</b> ").append(num(_organizer.getIntegrationThreshold())).append(" (").append(integrated).append(" well integrated peers)<br />");
out.write(buf.toString());
out.flush();
}

View File

@ -619,8 +619,8 @@ public class FIFOBandwidthLimiter {
public void renderStatusHTML(Writer out) throws IOException {
long now = now();
StringBuilder buf = new StringBuilder(4096);
buf.append("<p><b id=\"bwlim\">Limiter Status:</b><br />").append(getStatus().toString()).append("</p>\n");
buf.append("<p><b>Pending bandwidth requests:</b><ul>");
buf.append("<h3><b id=\"bwlim\">Limiter Status:</b></h3>").append(getStatus().toString()).append("\n");
buf.append("<h3>Pending bandwidth requests:</h3><ul>");
buf.append("<li>Inbound requests: <ol>");
synchronized (_pendingInboundRequests) {
for (int i = 0; i < _pendingInboundRequests.size(); i++) {
@ -643,7 +643,7 @@ public class FIFOBandwidthLimiter {
buf.append("ms ago</li>\n");
}
}
buf.append("</ol></li></ul></p>\n");
buf.append("</ol></li></ul></p><hr>\n");
out.write(buf.toString());
out.flush();
}

View File

@ -492,7 +492,7 @@ public class TransportManager implements TransportEventListener {
t.renderStatusHTML(out, urlBase, sortFlags);
}
StringBuilder buf = new StringBuilder(4*1024);
buf.append("<p><b>Router Transport Addresses:</b><br /><pre>\n");
buf.append("<h3>Router Transport Addresses:</h3><pre>\n");
for (int i = 0; i < _transports.size(); i++) {
Transport t = (Transport)_transports.get(i);
if (t.getCurrentAddress() != null)

View File

@ -639,19 +639,19 @@ public class NTCPTransport extends TransportImpl {
long totalRecv = 0;
StringBuilder buf = new StringBuilder(512);
buf.append("<p><b id=\"ntcpcon\">NTCP connections: ").append(peers.size());
buf.append(" limit: ").append(getMaxConnections());
buf.append(" timeout: ").append(DataHelper.formatDuration(_pumper.getIdleTimeout()));
buf.append("</b><br />\n");
buf.append("<table>\n");
buf.append("<p><b id=\"ntcpcon\"><h3>NTCP connections: ").append(peers.size());
buf.append(". Limit: ").append(getMaxConnections());
buf.append(". Timeout: ").append(DataHelper.formatDuration(_pumper.getIdleTimeout()));
buf.append(".</b></h3>\n");
buf.append("<div class=\"wideload\"><table>\n");
buf.append("<tr><th><a href=\"#def.peer\">Peer</a></th>");
buf.append("<th>Dir</th>");
buf.append("<th align=\"right\"><a href=\"#def.idle\">Idle</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.rate\">In/Out</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.up\">Up</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.skew\">Skew</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.send\">Send</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.recv\">Recv</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.send\">TX</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.recv\">RX</a></th>");
buf.append("<th>Out queue</th>");
buf.append("<th>Backlogged?</th>");
buf.append("<th>Reading?</th>");
@ -660,20 +660,20 @@ public class NTCPTransport extends TransportImpl {
buf.setLength(0);
for (Iterator iter = peers.iterator(); iter.hasNext(); ) {
NTCPConnection con = (NTCPConnection)iter.next();
buf.append("<tr><td align=\"right\" nowrap>");
buf.append("<tr> <td class=\"cells\" align=\"left\" nowrap>");
buf.append(_context.commSystem().renderPeerHTML(con.getRemotePeer().calculateHash()));
//byte[] ip = getIP(con.getRemotePeer().calculateHash());
//if (ip != null)
// buf.append(' ').append(_context.blocklist().toStr(ip));
buf.append("</td><td align=\"center\"><code>");
buf.append("</td> <td class=\"cells\" align=\"center\">");
if (con.isInbound())
buf.append("in");
buf.append("<img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"/>");
else
buf.append("out");
buf.append("</code></td><td align=\"right\"><code>");
buf.append("<img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"/>");
buf.append("</td> <td class=\"cells\" align=\"right\">");
buf.append(con.getTimeSinceReceive()/1000);
buf.append("s/").append(con.getTimeSinceSend()/1000);
buf.append("s</code></td><td align=\"right\"><code>");
buf.append("s</td> <td class=\"cells\" align=\"center\">");
if (con.getTimeSinceReceive() < 10*1000) {
buf.append(formatRate(con.getRecvRate()/1024));
bpsRecv += con.getRecvRate();
@ -687,47 +687,47 @@ public class NTCPTransport extends TransportImpl {
} else {
buf.append(formatRate(0));
}
buf.append("KBps");
buf.append("</code></td><td align=\"right\"><code>").append(DataHelper.formatDuration(con.getUptime()));
buf.append("K/s");
buf.append("</td> <td class=\"cells\" align=\"center\">").append(DataHelper.formatDuration(con.getUptime()));
totalUptime += con.getUptime();
offsetTotal = offsetTotal + con.getClockSkew();
buf.append("</code></td><td align=\"right\"><code>").append(con.getClockSkew());
buf.append("s</code></td><td align=\"right\"><code>").append(con.getMessagesSent());
buf.append("</td> <td class=\"cells\" align=\"center\">").append(con.getClockSkew());
buf.append("s</td> <td class=\"cells\" align=\"center\">").append(con.getMessagesSent());
totalSend += con.getMessagesSent();
buf.append("</code></td><td align=\"right\"><code>").append(con.getMessagesReceived());
buf.append("</td> <td class=\"cells\" align=\"center\">").append(con.getMessagesReceived());
totalRecv += con.getMessagesReceived();
long outQueue = con.getOutboundQueueSize();
if (outQueue <= 0) {
buf.append("</code></td><td align=\"right\"><code>No messages");
buf.append("</td> <td class=\"cells\" align=\"center\">No messages");
} else {
buf.append("</code></td><td align=\"right\"><code>").append(outQueue).append(" message");
buf.append("</td> <td class=\"cells\" align=\"center\">").append(outQueue).append(" message");
if (outQueue > 1)
buf.append("s");
}
buf.append("</code></td><td align=\"center\"><code>").append(con.getConsecutiveBacklog() > 0 ? "true" : "false");
buf.append("</td> <td class=\"cells\" align=\"center\">").append(con.getConsecutiveBacklog() > 0 ? "true" : "false");
long readTime = con.getReadTime();
if (readTime <= 0) {
buf.append("</code></td><td align=\"center\"><code>No");
buf.append("</td> <td class=\"cells\" align=\"center\">No");
} else {
buf.append("</code></td><td><code>For ").append(DataHelper.formatDuration(readTime));
buf.append("</td> <td class=\"cells\">For ").append(DataHelper.formatDuration(readTime));
}
buf.append("</code></td></tr>\n");
buf.append("</td></tr>\n");
out.write(buf.toString());
buf.setLength(0);
}
if (peers.size() > 0) {
buf.append("<tr><td colspan=\"11\"><hr /></td></tr>\n");
buf.append("<tr><td>").append(peers.size()).append(" peers</td><td>&nbsp;</td><td>&nbsp;");
buf.append("</td><td align=\"right\">").append(formatRate(bpsRecv/1024)).append("/").append(formatRate(bpsSend/1024)).append("KBps");
buf.append("</td><td align=\"right\">").append(DataHelper.formatDuration(totalUptime/peers.size()));
buf.append("</td><td align=\"right\">").append(peers.size() > 0 ? DataHelper.formatDuration(offsetTotal*1000/peers.size()) : "0ms");
buf.append("</td><td align=\"right\">").append(totalSend).append("</td><td align=\"right\">").append(totalRecv);
buf.append("</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;");
// buf.append("<tr> <td colspan=\"11\"><hr /></td></tr>\n");
buf.append("<tr class=\"tablefooter\"> <td align=\"center\"><b>").append(peers.size()).append(" peers</b></td> <td>&nbsp;</td> <td>&nbsp;");
buf.append("</td> <td align=\"center\"><b>").append(formatRate(bpsRecv/1024)).append("/").append(formatRate(bpsSend/1024)).append("K/s</b>");
buf.append("</td> <td align=\"center\"><b>").append(DataHelper.formatDuration(totalUptime/peers.size()));
buf.append("</b></td> <td align=\"center\"><b>").append(peers.size() > 0 ? DataHelper.formatDuration(offsetTotal*1000/peers.size()) : "0ms");
buf.append("</b></td> <td align=\"center\"><b>").append(totalSend).append("</b></td> <td align=\"center\"><b>").append(totalRecv);
buf.append("</b></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;");
buf.append("</td></tr>\n");
}
buf.append("</table></p>\n");
buf.append("</table></div></p>\n");
out.write(buf.toString());
buf.setLength(0);
}

View File

@ -1763,51 +1763,51 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
int numPeers = 0;
StringBuilder buf = new StringBuilder(512);
buf.append("<p><b id=\"udpcon\">UDP connections: ").append(peers.size());
buf.append(" limit: ").append(getMaxConnections());
buf.append(" timeout: ").append(DataHelper.formatDuration(_expireTimeout));
buf.append("</b><br />\n");
buf.append("<table>\n");
buf.append("<tr><th><a href=\"#def.peer\">Peer</a>");
buf.append("<p><b id=\"udpcon\"><h3>UDP connections: ").append(peers.size());
buf.append(". Limit: ").append(getMaxConnections());
buf.append(". Timeout: ").append(DataHelper.formatDuration(_expireTimeout));
buf.append(".</b></h3>\n");
buf.append("<div class=\"wideload\"><table>\n");
buf.append("<tr><th class=\"smallhead\" nowrap><a href=\"#def.peer\">Peer</a>");
if (sortFlags != FLAG_ALPHA)
buf.append(" <a href=\"").append(urlBase).append("?sort=0\">V</a> ");
buf.append("</th><th><a href=\"#def.dir\">Dir/Intro</a></th><th><a href=\"#def.idle\">Idle</a>");
buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.dir\" title=\"Direction/Introduction\">Dir</a></th><th class=\"smallhead\" nowrap><a href=\"#def.idle\">Idle</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by idle inbound", FLAG_IDLE_IN);
buf.append("/");
appendSortLinks(buf, urlBase, sortFlags, "Sort by idle outbound", FLAG_IDLE_OUT);
buf.append("</th>");
buf.append("<th><a href=\"#def.rate\">In/Out</a>");
buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.rate\">In/Out</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by inbound rate", FLAG_RATE_IN);
buf.append("/");
appendSortLinks(buf, urlBase, sortFlags, "Sort by outbound rate", FLAG_RATE_OUT);
buf.append("</th>\n");
buf.append("<th><a href=\"#def.up\">Up</a>");
buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.up\">Up</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by connection uptime", FLAG_UPTIME);
buf.append("</th><th><a href=\"#def.skew\">skew</a>");
buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.skew\">Skew</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by clock skew", FLAG_SKEW);
buf.append("</th>\n");
buf.append("<th><a href=\"#def.cwnd\">Cwnd</a>");
buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.cwnd\">Cwnd</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by congestion window", FLAG_CWND);
buf.append("</th><th><a href=\"#def.ssthresh\">Ssthresh</a>");
buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.ssthresh\">Sst</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by slow start threshold", FLAG_SSTHRESH);
buf.append("</th>\n");
buf.append("<th><a href=\"#def.rtt\">Rtt</a>");
buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.rtt\">Rtt</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by round trip time", FLAG_RTT);
buf.append("</th><th><a href=\"#def.dev\">Dev</a>");
buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.dev\">Dev</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by round trip time deviation", FLAG_DEV);
buf.append("</th><th><a href=\"#def.rto\">Rto</a>");
buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.rto\">Rto</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by retransmission timeout", FLAG_RTO);
buf.append("</th>\n");
buf.append("<th><a href=\"#def.mtu\">Mtu</a>");
buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.mtu\">Mtu</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by maximum transmit unit", FLAG_MTU);
buf.append("</th><th><a href=\"#def.send\">Send</a>");
buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.send\">TX</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by packets sent", FLAG_SEND);
buf.append("</th><th><a href=\"#def.recv\">Recv</a>");
buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.recv\">RX</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by packets received", FLAG_RECV);
buf.append("</th>\n");
buf.append("<th><a href=\"#def.resent\">Resent</a>");
buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.resent\">ReTX</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by packets retransmitted", FLAG_RESEND);
buf.append("</th><th><a href=\"#def.dupRecv\">DupRecv</a>");
buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.dupRecv\">DupRX</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by packets received more than once", FLAG_DUP);
buf.append("</th>\n");
buf.append("</tr>\n");
@ -1819,16 +1819,16 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
if (now-peer.getLastReceiveTime() > 60*60*1000)
continue; // don't include old peers
buf.append("<tr><td align=\"right\" nowrap>");
buf.append("<tr> <td class=\"cells\" align=\"left\" nowrap>");
buf.append(_context.commSystem().renderPeerHTML(peer.getRemotePeer()));
//byte ip[] = peer.getRemoteIP();
//if (ip != null)
// buf.append(' ').append(_context.blocklist().toStr(ip));
buf.append("</td><td><code>");
buf.append("</td> <td class=\"cells\" nowrap align=\"left\">");
if (peer.isInbound())
buf.append("in ");
buf.append("<img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"/> ");
else
buf.append("out ");
buf.append("<img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"/> ");
if (peer.getWeRelayToThemAs() > 0)
buf.append("^");
else
@ -1839,107 +1839,107 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
boolean appended = false;
if (_activeThrottle.isChoked(peer.getRemotePeer())) {
if (!appended) buf.append("<br />");
buf.append(" [choked]");
buf.append(" <i>Choked</i>");
appended = true;
}
if (peer.getConsecutiveFailedSends() > 0) {
if (!appended) buf.append("<br />");
buf.append(" [").append(peer.getConsecutiveFailedSends()).append(" failures]");
buf.append(" <i>").append(peer.getConsecutiveFailedSends()).append(" fail(s)</i>");
appended = true;
}
if (_context.shitlist().isShitlisted(peer.getRemotePeer(), STYLE)) {
if (!appended) buf.append("<br />");
buf.append(" [shitlisted]");
buf.append(" <i>Shitlist</i>");
appended = true;
}
//byte[] ip = getIP(peer.getRemotePeer());
//if (ip != null)
// buf.append(' ').append(_context.blocklist().toStr(ip));
buf.append("</code></td>");
buf.append("</td>");
long idleIn = (now-peer.getLastReceiveTime())/1000;
long idleOut = (now-peer.getLastSendTime())/1000;
if (idleIn < 0) idleIn = 0;
if (idleOut < 0) idleOut = 0;
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"right\" >");
buf.append(idleIn);
buf.append("s/");
buf.append(idleOut);
buf.append("s</code></td>");
buf.append("s</td>");
int recvBps = (idleIn > 2 ? 0 : peer.getReceiveBps());
int sendBps = (idleOut > 2 ? 0 : peer.getSendBps());
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"right\" nowrap>");
buf.append(formatKBps(recvBps));
buf.append("/");
buf.append(formatKBps(sendBps));
buf.append("KBps ");
buf.append("K/s ");
//buf.append(formatKBps(peer.getReceiveACKBps()));
//buf.append("KBps/");
//buf.append("K/s/");
//buf.append(formatKBps(peer.getSendACKBps()));
//buf.append("KBps ");
buf.append("</code></td>");
//buf.append("K/s ");
buf.append("</td>");
long uptime = now - peer.getKeyEstablishedTime();
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"center\" >");
buf.append(DataHelper.formatDuration(uptime));
buf.append("</code></td>");
buf.append("</td>");
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"center\" >");
buf.append(peer.getClockSkew());
buf.append("s</code></td>");
buf.append("s</td>");
offsetTotal = offsetTotal + peer.getClockSkew();
long sendWindow = peer.getSendWindowBytes();
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"right\" >");
buf.append(sendWindow/1024);
buf.append("K");
buf.append("/").append(peer.getConcurrentSends());
buf.append("/").append(peer.getConcurrentSendWindow());
buf.append("/").append(peer.getConsecutiveSendRejections());
buf.append("</code></td>");
buf.append("</td>");
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"center\" >");
buf.append(peer.getSlowStartThreshold()/1024);
buf.append("K</code></td>");
buf.append("K</td>");
int rtt = peer.getRTT();
int rto = peer.getRTO();
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"right\" >");
buf.append(rtt);
buf.append("</code></td>");
buf.append("</td>");
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"right\" >");
buf.append(peer.getRTTDeviation());
buf.append("</code></td>");
buf.append("</td>");
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"right\" >");
buf.append(rto);
buf.append("</code></td>");
buf.append("</td>");
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"right\" >");
buf.append(peer.getMTU()).append("/").append(peer.getReceiveMTU());
//.append('/');
//buf.append(peer.getMTUIncreases()).append('/');
//buf.append(peer.getMTUDecreases());
buf.append("</code></td>");
buf.append("</td>");
long sent = peer.getPacketsTransmitted();
long recv = peer.getPacketsReceived();
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"center\" >");
buf.append(sent);
buf.append("</code></td>");
buf.append("</td>");
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"center\" >");
buf.append(recv);
buf.append("</code></td>");
buf.append("</td>");
//double sent = (double)peer.getPacketsPeriodTransmitted();
//double sendLostPct = 0;
@ -1949,16 +1949,16 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
long resent = peer.getPacketsRetransmitted();
long dupRecv = peer.getPacketsReceivedDuplicate();
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"center\" >");
//buf.append(formatPct(sendLostPct));
buf.append(resent); // + "/" + peer.getPacketsPeriodRetransmitted() + "/" + sent);
//buf.append(peer.getPacketRetransmissionRate());
buf.append("</code></td>");
buf.append("</td>");
double recvDupPct = (double)peer.getPacketsReceivedDuplicate()/(double)peer.getPacketsReceived();
buf.append("<td align=\"right\" ><code>");
buf.append(" <td class=\"cells\" align=\"center\" >");
buf.append(dupRecv); //formatPct(recvDupPct));
buf.append("</code></td>");
buf.append("</td>");
buf.append("</tr>\n");
out.write(buf.toString());
@ -1980,25 +1980,25 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
numPeers++;
}
buf.append("<tr><td colspan=\"16\"><hr /></td></tr>\n");
buf.append(" <tr><td colspan=\"3\"><b>Total</b></td>");
buf.append(" <td align=\"right\">");
// buf.append("<tr><td colspan=\"16\"><hr /></td></tr>\n");
buf.append(" <tr class=\"tablefooter\"> <td colspan=\"3\" align=\"right\"><b>Total</b></td>");
buf.append(" <td align=\"center\" nowrap><b>");
buf.append(formatKBps(bpsIn)).append("/").append(formatKBps(bpsOut));
buf.append("KBps</td>");
buf.append(" <td align=\"right\">").append(numPeers > 0 ? DataHelper.formatDuration(uptimeMsTotal/numPeers) : "0s");
buf.append("</td><td align=\"right\">").append(numPeers > 0 ? DataHelper.formatDuration(offsetTotal*1000/numPeers) : "0ms").append("</td>\n");
buf.append(" <td align=\"right\">");
buf.append("K/s</b></td>");
buf.append(" <td align=\"center\"><b>").append(numPeers > 0 ? DataHelper.formatDuration(uptimeMsTotal/numPeers) : "0s");
buf.append("</b></td> <td align=\"center\"><b>").append(numPeers > 0 ? DataHelper.formatDuration(offsetTotal*1000/numPeers) : "0ms").append("</b></td>\n");
buf.append(" <td align=\"center\"><b>");
buf.append(numPeers > 0 ? cwinTotal/(numPeers*1024) + "K" : "0K");
buf.append("</td><td>&nbsp;</td>\n");
buf.append(" <td align=\"right\">");
buf.append("</b></td> <td>&nbsp;</td>\n");
buf.append(" <td align=\"center\"><b>");
buf.append(numPeers > 0 ? rttTotal/numPeers : 0);
buf.append("</td><td align=\"right\">&nbsp;</td><td align=\"right\">");
buf.append("</b></td> <td>&nbsp;</td> <td align=\"center\"><b>");
buf.append(numPeers > 0 ? rtoTotal/numPeers : 0);
buf.append("</td>\n <td>&nbsp;</td><td align=\"right\">");
buf.append(sendTotal).append("</td><td align=\"right\">").append(recvTotal).append("</td>\n");
buf.append(" <td align=\"right\">").append(resentTotal);
buf.append("</td><td align=\"right\">").append(dupRecvTotal).append("</td>\n");
buf.append(" </tr></table></p><p>\n");
buf.append("</b></td>\n <td>&nbsp;</td> <td align=\"center\"><b>");
buf.append(sendTotal).append("</td></b> <td align=\"center\"><b>").append(recvTotal).append("</b></td>\n");
buf.append(" <td align=\"center\"><b>").append(resentTotal);
buf.append("</b></td> <td align=\"center\"><b>").append(dupRecvTotal).append("</b></td>\n");
buf.append(" </tr></table></div></p><p>\n");
long bytesTransmitted = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes();
// NPE here early
double averagePacketSize = _context.statManager().getRate("udp.sendPacketSize").getLifetimeAverageValue();
@ -2006,8 +2006,8 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
resentTotal = (long)_context.statManager().getRate("udp.packetsRetransmitted").getLifetimeEventCount();
double nondupSent = ((double)bytesTransmitted - ((double)resentTotal)*averagePacketSize);
double bwResent = (nondupSent <= 0 ? 0d : ((((double)resentTotal)*averagePacketSize) / nondupSent));
buf.append("Percentage of bytes retransmitted (lifetime): ").append(formatPct(bwResent));
buf.append(" <i>(includes retransmission required by packet loss)</i><br /></p>\n");
buf.append("<h3>Percentage of bytes retransmitted (lifetime): ").append(formatPct(bwResent));
buf.append("</h3><i>(Includes retransmission required by packet loss)</i><br /></p>\n");
out.write(buf.toString());
buf.setLength(0);
out.write(KEY);
@ -2026,27 +2026,27 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
}
}
private static final String KEY = "<p>" +
"<b id=\"def.peer\">peer</b>: the remote peer<br />\n" +
"<b id=\"def.dir\">dir</b>: v means they offer to introduce us, ^ means we offer to introduce them<br />\n" +
"<b id=\"def.idle\">idle</b>: the idle time is how long since a packet has been received or sent<br />\n" +
"<b id=\"def.rate\">in/out</b>: the rates show a smoothed inbound and outbound transfer rate (KBytes per second)<br />\n" +
"<b id=\"def.up\">up</b>: the uptime is how long ago this session was established<br />\n" +
"<b id=\"def.skew\">skew</b>: the skew says how far off the other user's clock is, relative to your own<br />\n" +
"<b id=\"def.cwnd\">cwnd</b>: the congestion window is how many bytes in 'in flight' you can send w/out an acknowledgement / <br />\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the number of currently active messages being sent /<br />\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the maximum number of concurrent messages to send /<br />\n"+
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the number of consecutive sends which were blocked due to throws message window size<br />\n" +
"<b id=\"def.ssthresh\">ssthresh</b>: the slow start threshold help make sure the cwnd doesn't grow too fast<br />\n" +
"<b id=\"def.rtt\">rtt</b>: the round trip time is how long it takes to get an acknowledgement of a packet<br />\n" +
"<b id=\"def.dev\">dev</b>: the standard deviation of the round trip time, to help control the retransmit timeout<br />\n" +
"<b id=\"def.rto\">rto</b>: the retransmit timeout controls how frequently an unacknowledged packet will be retransmitted<br />\n" +
"<b id=\"def.mtu\">mtu</b>: current sending packet size / estimated receiving packet size<br />\n" +
"<b id=\"def.send\">send</b>: the number of packets sent to the peer<br />\n" +
"<b id=\"def.recv\">recv</b>: the number of packets received from the peer<br />\n" +
"<b id=\"def.resent\">resent</b>: the number of packets retransmitted to the peer<br />\n" +
"<b id=\"def.dupRecv\">dupRecv</b>: the number of duplicate packets received from the peer" +
"</p>\n";
private static final String KEY = "<h3>Definitions:</h3><div class=\"configure\">" +
"<br><b id=\"def.peer\">Peer</b>: the remote peer.<br />\n" +
"<b id=\"def.dir\">Dir</b>: v means they offer to introduce us, ^ means we offer to introduce them.<br />\n" +
"<b id=\"def.idle\">Idle</b>: the idle time is how long since a packet has been received or sent.<br />\n" +
"<b id=\"def.rate\">In/out</b>: the rates show a smoothed inbound and outbound transfer rate (KBytes per second).<br />\n" +
"<b id=\"def.up\">Up</b>: the uptime is how long ago this session was established.<br />\n" +
"<b id=\"def.skew\">Skew</b>: the skew says how far off the other user's clock is, relative to your own.<br />\n" +
"<b id=\"def.cwnd\">Cwnd</b>: the congestion window is how many bytes in 'in flight' you can send w/out an acknowledgement, / <br />\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the number of currently active messages being sent, /<br />\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the maximum number of concurrent messages to send, /<br />\n"+
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the number of consecutive sends which were blocked due to throws message window size.<br />\n" +
"<b id=\"def.ssthresh\">Sst</b>: the slow start threshold helps make sure the cwnd doesn't grow too fast.<br />\n" +
"<b id=\"def.rtt\">Rtt</b>: the round trip time is how long it takes to get an acknowledgement of a packet.<br />\n" +
"<b id=\"def.dev\">Dev</b>: the standard deviation of the round trip time, to help control the retransmit timeout.<br />\n" +
"<b id=\"def.rto\">Rto</b>: the retransmit timeout controls how frequently an unacknowledged packet will be retransmitted.<br />\n" +
"<b id=\"def.mtu\">Mtu</b>: current sending packet size / estimated receiving packet size.<br />\n" +
"<b id=\"def.send\">TX</b>: the number of packets sent to the peer.<br />\n" +
"<b id=\"def.recv\">RX</b>: the number of packets received from the peer.<br />\n" +
"<b id=\"def.resent\">ReTX</b>: the number of packets retransmitted to the peer.<br />\n" +
"<b id=\"def.dupRecv\">DupRX</b>: the number of duplicate packets received from the peer." +
"</div>\n";
/**
* Cache the bid to reduce object churn

View File

@ -405,7 +405,7 @@ public class TunnelPoolManager implements TunnelManagerFacade {
public void renderStatusHTML(Writer out) throws IOException {
out.write("<h2><a name=\"exploratory\" ></a>Exploratory tunnels (<a href=\"/configtunnels.jsp#exploratory\">config</a>):</h2>\n");
out.write("<div class=\"wideload\"><h2><a name=\"exploratory\" ></a>Exploratory tunnels (<a href=\"/configtunnels.jsp#exploratory\">config</a>):</h2>\n");
renderPool(out, _inboundExploratory, _outboundExploratory);
List destinations = null;
@ -455,41 +455,41 @@ public class TunnelPoolManager implements TunnelManagerFacade {
}
out.write("<tr>");
if (cfg.getReceiveTunnel() != null)
out.write("<td align=\"center\">" + cfg.getReceiveTunnel().getTunnelId() +"</td>");
out.write(" <td class=\"cells\" align=\"center\">" + cfg.getReceiveTunnel().getTunnelId() +"</td>");
else
out.write("<td align=\"center\">n/a</td>");
out.write(" <td class=\"cells\" align=\"center\">n/a</td>");
if (cfg.getReceiveFrom() != null)
out.write("<td align=\"right\">" + netDbLink(cfg.getReceiveFrom()) +"</td>");
out.write(" <td class=\"cells\" align=\"right\">" + netDbLink(cfg.getReceiveFrom()) +"</td>");
else
out.write("<td align=\"center\">&nbsp;</td>");
out.write(" <td class=\"cells\" align=\"center\">&nbsp;</td>");
if (cfg.getSendTunnel() != null)
out.write("<td align=\"center\">" + cfg.getSendTunnel().getTunnelId() +"</td>");
out.write(" <td class=\"cells\" align=\"center\">" + cfg.getSendTunnel().getTunnelId() +"</td>");
else
out.write("<td align=\"center\">&nbsp;</td>");
out.write(" <td class=\"cells\" align=\"center\">&nbsp;</td>");
if (cfg.getSendTo() != null)
out.write("<td align=\"center\">" + netDbLink(cfg.getSendTo()) +"</td>");
out.write(" <td class=\"cells\" align=\"center\">" + netDbLink(cfg.getSendTo()) +"</td>");
else
// out.write("<td align=\"center\">&nbsp;</td>");
out.write("<td align=\"center\">&nbsp;</td>");
// out.write(" <td class=\"cells\" align=\"center\">&nbsp;</td>");
out.write(" <td class=\"cells\" align=\"center\">&nbsp;</td>");
long timeLeft = cfg.getExpiration()-_context.clock().now();
if (timeLeft > 0)
out.write("<td align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>");
out.write(" <td class=\"cells\" align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>");
else
out.write("<td align=\"center\">(grace period)</td>");
out.write("<td align=\"center\">" + cfg.getProcessedMessagesCount() + "KB</td>");
out.write(" <td class=\"cells\" align=\"center\">(grace period)</td>");
out.write(" <td class=\"cells\" align=\"center\">" + cfg.getProcessedMessagesCount() + "KB</td>");
int lifetime = (int) ((_context.clock().now() - cfg.getCreation()) / 1000);
if (lifetime <= 0)
lifetime = 1;
if (lifetime > 10*60)
lifetime = 10*60;
int bps = 1024 * (int) cfg.getProcessedMessagesCount() / lifetime;
out.write("<td align=\"center\">" + bps + "Bps</td>");
out.write(" <td class=\"cells\" align=\"center\">" + bps + "Bps</td>");
if (cfg.getSendTo() == null)
out.write("<td align=\"center\">Outbound Endpoint</td>");
out.write(" <td class=\"cells\" align=\"center\">Outbound Endpoint</td>");
else if (cfg.getReceiveFrom() == null)
out.write("<td align=\"center\">Inbound Gateway</td>");
out.write(" <td class=\"cells\" align=\"center\">Inbound Gateway</td>");
else
out.write("<td align=\"center\">Participant</td>");
out.write(" <td class=\"cells\" align=\"center\">Participant</td>");
out.write("</tr>\n");
processed += cfg.getProcessedMessagesCount();
}
@ -543,23 +543,23 @@ public class TunnelPoolManager implements TunnelManagerFacade {
continue; // don't display tunnels in their grace period
live++;
if (info.isInbound())
out.write("<tr><td align=\"center\"><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"/></td>");
out.write("<tr> <td class=\"cells\" align=\"center\"><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"/></td>");
else
out.write("<tr><td align=\"center\"><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"/></td>");
out.write("<td align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>\n");
out.write("<td align=\"center\">" + info.getProcessedMessagesCount() + "KB</td>\n");
out.write("<tr> <td class=\"cells\" align=\"center\"><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"/></td>");
out.write(" <td class=\"cells\" align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>\n");
out.write(" <td class=\"cells\" align=\"center\">" + info.getProcessedMessagesCount() + "KB</td>\n");
for (int j = 0; j < info.getLength(); j++) {
Hash peer = info.getPeer(j);
TunnelId id = (info.isInbound() ? info.getReceiveTunnelId(j) : info.getSendTunnelId(j));
if (_context.routerHash().equals(peer)) {
out.write("<td align=\"center\">" + (id == null ? "" : "" + id) + "</td>");
out.write(" <td class=\"cells\" align=\"center\">" + (id == null ? "" : "" + id) + "</td>");
} else {
String cap = getCapacity(peer);
out.write("<td align=\"center\">" + netDbLink(peer) + (id == null ? "" : " " + id) + cap + "</td>");
out.write(" <td class=\"cells\" align=\"center\">" + netDbLink(peer) + (id == null ? "" : " " + id) + cap + "</td>");
}
if (info.getLength() < maxLength && (info.getLength() == 1 || j == info.getLength() - 2)) {
for (int k = info.getLength(); k < maxLength; k++)
out.write("<td align=\"center\">&nbsp</td>");
out.write(" <td class=\"cells\" align=\"center\">&nbsp</td>");
}
}
out.write("</tr>\n");
@ -583,8 +583,8 @@ public class TunnelPoolManager implements TunnelManagerFacade {
live += pending.size();
}
if (live <= 0)
out.write("<div class=\"statusnotes\"><center>N<b>No tunnels; waiting for the grace period to end.</center></b></div>\n");
out.write("<div class=\"statusnotes\"><center><b>Lifetime bandwidth usage: " + DataHelper.formatSize(processedIn*1024) + "<B in, " +
out.write("<div class=\"statusnotes\"><center><b>No tunnels; waiting for the grace period to end.</center></b></div>\n");
out.write("<div class=\"statusnotes\"><center><b>Lifetime bandwidth usage: " + DataHelper.formatSize(processedIn*1024) + "B in, " +
DataHelper.formatSize(processedOut*1024) + "B out</b></center></div>");
}
@ -605,25 +605,25 @@ public class TunnelPoolManager implements TunnelManagerFacade {
out.write("<h2><a name=\"peers\"></a>Tunnel Counts By Peer:</h2>\n");
out.write("<table><tr><th>Peer</th><th>Expl. + Client</th><th>% of total</th><th>Part. from + to</th><th>% of total</th></tr>\n");
for (Hash h : peerList) {
out.write("<tr><td align=\"center\">");
out.write("<tr> <td class=\"cells\" align=\"center\">");
out.write(netDbLink(h));
out.write("<td align=\"center\">" + lc.count(h));
out.write("<td align=\"center\">");
out.write(" <td class=\"cells\" align=\"center\">" + lc.count(h));
out.write(" <td class=\"cells\" align=\"center\">");
if (tunnelCount > 0)
out.write("" + (lc.count(h) * 100 / tunnelCount));
else
out.write('0');
out.write("<td align=\"center\">" + pc.count(h));
out.write("<td align=\"center\">");
out.write(" <td class=\"cells\" align=\"center\">" + pc.count(h));
out.write(" <td class=\"cells\" align=\"center\">");
if (partCount > 0)
out.write("" + (pc.count(h) * 100 / partCount));
else
out.write('0');
out.write('\n');
}
out.write("<tr><td align=\"center\"><b>Tunnels</b><td align=\"center\"><b>" + tunnelCount);
out.write("</b><td>&nbsp;</td><td align=\"center\"><b>" + partCount);
out.write("</b><td>&nbsp;</td></tr></table>\n");
out.write("<tr class=\"tablefooter\"> <td align=\"center\"><b>Tunnels</b> <td align=\"center\"><b>" + tunnelCount);
out.write("</b> <td>&nbsp;</td> <td align=\"center\"><b>" + partCount);
out.write("</b> <td>&nbsp;</td></tr></table></div>\n");
}
/** @return total number of non-fallback expl. + client tunnels */