Ongoing UI enhancements; peers.jsp gets some love.
This commit is contained in:
@ -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");
|
||||
|
@ -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();
|
||||
|
@ -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>");
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -639,10 +639,10 @@ 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("<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("<table>\n");
|
||||
buf.append("<tr><th><a href=\"#def.peer\">Peer</a></th>");
|
||||
buf.append("<th>Dir</th>");
|
||||
@ -650,8 +650,8 @@ public class NTCPTransport extends TransportImpl {
|
||||
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>");
|
||||
@ -665,15 +665,15 @@ public class NTCPTransport extends TransportImpl {
|
||||
//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 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 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 align=\"right\">");
|
||||
if (con.getTimeSinceReceive() < 10*1000) {
|
||||
buf.append(formatRate(con.getRecvRate()/1024));
|
||||
bpsRecv += con.getRecvRate();
|
||||
@ -687,43 +687,43 @@ 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 align=\"right\">").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 align=\"right\">").append(con.getClockSkew());
|
||||
buf.append("s</td><td align=\"right\">").append(con.getMessagesSent());
|
||||
totalSend += con.getMessagesSent();
|
||||
buf.append("</code></td><td align=\"right\"><code>").append(con.getMessagesReceived());
|
||||
buf.append("</td><td align=\"right\">").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 align=\"right\">No messages");
|
||||
} else {
|
||||
buf.append("</code></td><td align=\"right\"><code>").append(outQueue).append(" message");
|
||||
buf.append("</td><td align=\"right\">").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 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 align=\"center\">No");
|
||||
} else {
|
||||
buf.append("</code></td><td><code>For ").append(DataHelper.formatDuration(readTime));
|
||||
buf.append("</td><td>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> </td><td> ");
|
||||
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> </td><td> </td><td> ");
|
||||
buf.append("<tr><td align=\"center\"><b>").append(peers.size()).append(" peers</b></td><td> </td><td> ");
|
||||
buf.append("</td><td align=\"right\"><b>").append(formatRate(bpsRecv/1024)).append("/").append(formatRate(bpsSend/1024)).append("K/s</b>");
|
||||
buf.append("</td><td align=\"right\"><b>").append(DataHelper.formatDuration(totalUptime/peers.size()));
|
||||
buf.append("</b></td><td align=\"right\"><b>").append(peers.size() > 0 ? DataHelper.formatDuration(offsetTotal*1000/peers.size()) : "0ms");
|
||||
buf.append("</b></td><td align=\"right\"><b>").append(totalSend).append("</b></td><td align=\"right\"><b>").append(totalRecv);
|
||||
buf.append("</b></td><td> </td><td> </td><td> ");
|
||||
buf.append("</td></tr>\n");
|
||||
}
|
||||
|
||||
|
@ -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("<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("<table>\n");
|
||||
buf.append("<tr><th><a href=\"#def.peer\">Peer</a>");
|
||||
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\">Dir/Intro</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");
|
||||
@ -1824,11 +1824,11 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
//byte ip[] = peer.getRemoteIP();
|
||||
//if (ip != null)
|
||||
// buf.append(' ').append(_context.blocklist().toStr(ip));
|
||||
buf.append("</td><td><code>");
|
||||
buf.append("</td><td nowrap>");
|
||||
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 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 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 align=\"right\" >");
|
||||
buf.append(DataHelper.formatDuration(uptime));
|
||||
buf.append("</code></td>");
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("<td align=\"right\" ><code>");
|
||||
buf.append("<td align=\"right\" >");
|
||||
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 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 align=\"right\" >");
|
||||
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 align=\"right\" >");
|
||||
buf.append(rtt);
|
||||
buf.append("</code></td>");
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("<td align=\"right\" ><code>");
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(peer.getRTTDeviation());
|
||||
buf.append("</code></td>");
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("<td align=\"right\" ><code>");
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(rto);
|
||||
buf.append("</code></td>");
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("<td align=\"right\" ><code>");
|
||||
buf.append("<td 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 align=\"right\" >");
|
||||
buf.append(sent);
|
||||
buf.append("</code></td>");
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("<td align=\"right\" ><code>");
|
||||
buf.append("<td align=\"right\" >");
|
||||
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 align=\"right\" >");
|
||||
//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 align=\"right\" >");
|
||||
buf.append(dupRecv); //formatPct(recvDupPct));
|
||||
buf.append("</code></td>");
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("</tr>\n");
|
||||
out.write(buf.toString());
|
||||
@ -1982,22 +1982,22 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
|
||||
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(" <td align=\"right\" 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=\"right\"><b>").append(numPeers > 0 ? DataHelper.formatDuration(uptimeMsTotal/numPeers) : "0s");
|
||||
buf.append("</b></td><td align=\"right\"><b>").append(numPeers > 0 ? DataHelper.formatDuration(offsetTotal*1000/numPeers) : "0ms").append("</b></td>\n");
|
||||
buf.append(" <td align=\"right\"><b>");
|
||||
buf.append(numPeers > 0 ? cwinTotal/(numPeers*1024) + "K" : "0K");
|
||||
buf.append("</td><td> </td>\n");
|
||||
buf.append(" <td align=\"right\">");
|
||||
buf.append("</b></td><td> </td>\n");
|
||||
buf.append(" <td align=\"right\"><b>");
|
||||
buf.append(numPeers > 0 ? rttTotal/numPeers : 0);
|
||||
buf.append("</td><td align=\"right\"> </td><td align=\"right\">");
|
||||
buf.append("</b></td><td align=\"right\"> </td><td align=\"right\"><b>");
|
||||
buf.append(numPeers > 0 ? rtoTotal/numPeers : 0);
|
||||
buf.append("</td>\n <td> </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("</b></td>\n <td> </td><td align=\"right\"><b>");
|
||||
buf.append(sendTotal).append("</td></b><td align=\"right\"><b>").append(recvTotal).append("</b></td>\n");
|
||||
buf.append(" <td align=\"right\"><b>").append(resentTotal);
|
||||
buf.append("</b></td><td align=\"right\"><b>").append(dupRecvTotal).append("</b></td>\n");
|
||||
buf.append(" </tr></table></p><p>\n");
|
||||
long bytesTransmitted = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes();
|
||||
// NPE here early
|
||||
@ -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" +
|
||||
" the number of currently active messages being sent /<br />\n" +
|
||||
" the maximum number of concurrent messages to send /<br />\n"+
|
||||
" 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>Explanation of abbreviated terms used.</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" +
|
||||
" the number of currently active messages being sent, /<br />\n" +
|
||||
" the maximum number of concurrent messages to send, /<br />\n"+
|
||||
" 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
|
||||
|
Reference in New Issue
Block a user