diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/PeerHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/PeerHelper.java index a47348231a..832714e691 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/PeerHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/PeerHelper.java @@ -228,8 +228,9 @@ public class PeerHelper extends HelperBase { .append("").append(_t("Idle")).append("").append(_t("How long since a packet has been received / sent")).append("\n") .append("").append(_t("In/Out")).append("").append(_t("The smoothed inbound / outbound transfer rate (KBytes per second)")).append("\n") .append("").append(_t("Up")).append("").append(_t("How long ago this connection was established")).append("\n") - .append("").append(_t("Skew")).append("").append(_t("The difference between the peer's clock and your own")).append("\n") - .append("CWND").append(_t("The congestion window, which is how many bytes can be sent without an acknowledgement")).append(" /
\n") + .append("").append(_t("Skew")).append("").append(_t("The difference between the peer's clock and your own")).append("\n"); + if (isAdvanced()) { + buf.append("CWND").append(_t("The congestion window, which is how many bytes can be sent without an acknowledgement")).append(" /
\n") .append(_t("The number of sent messages awaiting acknowledgement")).append(" /
\n") .append(_t("The maximum number of concurrent messages to send")).append(" /
\n") .append(_t("The number of pending sends which exceed congestion window")).append("\n") @@ -237,8 +238,9 @@ public class PeerHelper extends HelperBase { .append("RTT").append(_t("The round trip time in milliseconds")).append("\n") //.append("").append(_t("Dev")).append("").append(_t("The standard deviation of the round trip time in milliseconds")).append("\n") .append("RTO").append(_t("The retransmit timeout in milliseconds")).append("\n") - .append("MTU").append(_t("Current maximum send packet size / estimated maximum receive packet size (bytes)")).append("\n") - .append("").append(_t("TX")).append("").append(_t("The total number of messages sent to the peer")).append("\n") + .append("MTU").append(_t("Current maximum send packet size / estimated maximum receive packet size (bytes)")).append("\n"); + } + buf.append("").append(_t("TX")).append("").append(_t("The total number of messages sent to the peer")).append("\n") .append("").append(_t("RX")).append("").append(_t("The total number of messages received from the peer")).append("\n") .append("").append(_t("Dup TX")).append("").append(_t("The total number of packets retransmitted to the peer")).append("\n") .append("").append(_t("Dup RX")).append("").append(_t("The total number of duplicate packets received from the peer")).append("\n") @@ -437,7 +439,8 @@ public class PeerHelper extends HelperBase { buf.append("

").append(_t("UDP connections")).append(": ").append(peers.size()); buf.append(". ").append(_t("Limit")).append(": ").append(ut.getMaxConnections()); //buf.append(". ").append(_t("Timeout")).append(": ").append(DataHelper.formatDuration2(_expireTimeout)); - if (isAdvanced()) { + final boolean isAdvanced = isAdvanced(); + if (isAdvanced) { buf.append(". ").append(_t("Status")).append(": ").append(_t(ut.getReachabilityStatus().toStatusString())); } buf.append(".

\n"); @@ -463,21 +466,24 @@ public class PeerHelper extends HelperBase { buf.append("").append(_t("Skew")).append("
"); appendSortLinks(buf, urlBase, sortFlags, _t("Sort by clock skew"), FLAG_SKEW); buf.append("
\n"); - buf.append("CWND
"); - appendSortLinks(buf, urlBase, sortFlags, _t("Sort by congestion window"), FLAG_CWND); - buf.append("SST
"); - appendSortLinks(buf, urlBase, sortFlags, _t("Sort by slow start threshold"), FLAG_SSTHRESH); - buf.append("
\n"); - buf.append("RTT
"); - appendSortLinks(buf, urlBase, sortFlags, _t("Sort by round trip time"), FLAG_RTT); - //buf.append("").append(_t("Dev")).append("
"); - //appendSortLinks(buf, urlBase, sortFlags, _t("Sort by round trip time deviation"), FLAG_DEV); - buf.append("
RTO
"); - appendSortLinks(buf, urlBase, sortFlags, _t("Sort by retransmission timeout"), FLAG_RTO); - buf.append("
\n"); - buf.append("MTU
"); - appendSortLinks(buf, urlBase, sortFlags, _t("Sort by outbound maximum transmit unit"), FLAG_MTU); - buf.append("").append(_t("TX")).append("
"); + if (isAdvanced) { + buf.append("CWND
"); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by congestion window"), FLAG_CWND); + buf.append("SST
"); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by slow start threshold"), FLAG_SSTHRESH); + buf.append("
\n"); + buf.append("RTT
"); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by round trip time"), FLAG_RTT); + //buf.append("").append(_t("Dev")).append("
"); + //appendSortLinks(buf, urlBase, sortFlags, _t("Sort by round trip time deviation"), FLAG_DEV); + buf.append("
RTO
"); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by retransmission timeout"), FLAG_RTO); + buf.append("
\n"); + buf.append("MTU
"); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by outbound maximum transmit unit"), FLAG_MTU); + buf.append(""); + } + buf.append("").append(_t("TX")).append("
"); appendSortLinks(buf, urlBase, sortFlags, _t("Sort by packets sent"), FLAG_SEND); buf.append("
").append(_t("RX")).append("
"); appendSortLinks(buf, urlBase, sortFlags, _t("Sort by packets received"), FLAG_RECV); @@ -576,46 +582,50 @@ public class PeerHelper extends HelperBase { long sendWindow = peer.getSendWindowBytes(); - buf.append(""); - buf.append(sendWindow/1024); - buf.append("K"); - buf.append("").append(THINSP).append("").append(peer.getConcurrentSends()); - buf.append("").append(THINSP).append("").append(peer.getConcurrentSendWindow()); - buf.append("").append(THINSP).append("").append(peer.getConsecutiveSendRejections()); - if (peer.isBacklogged()) - buf.append(' ').append(_t("backlogged")); - buf.append(""); + int rtt = 0; + int rto = 0; + if (isAdvanced) { + buf.append(""); + buf.append(sendWindow/1024); + buf.append("K"); + buf.append("").append(THINSP).append("").append(peer.getConcurrentSends()); + buf.append("").append(THINSP).append("").append(peer.getConcurrentSendWindow()); + buf.append("").append(THINSP).append("").append(peer.getConsecutiveSendRejections()); + if (peer.isBacklogged()) + buf.append(' ').append(_t("backlogged")); + buf.append(""); - buf.append(""); - buf.append(peer.getSlowStartThreshold()/1024); - buf.append("K"); + buf.append(""); + buf.append(peer.getSlowStartThreshold()/1024); + buf.append("K"); - int rtt = peer.getRTT(); - int rto = peer.getRTO(); + rtt = peer.getRTT(); + rto = peer.getRTO(); - buf.append(""); - if (rtt > 0) - buf.append(DataHelper.formatDuration2(rtt)); - else - buf.append("n/a"); - buf.append(""); + buf.append(""); + if (rtt > 0) + buf.append(DataHelper.formatDuration2(rtt)); + else + buf.append("n/a"); + buf.append(""); - //buf.append(""); - //buf.append(DataHelper.formatDuration2(peer.getRTTDeviation())); - //buf.append(""); + //buf.append(""); + //buf.append(DataHelper.formatDuration2(peer.getRTTDeviation())); + //buf.append(""); - buf.append(""); - buf.append(DataHelper.formatDuration2(rto)); - buf.append(""); + buf.append(""); + buf.append(DataHelper.formatDuration2(rto)); + buf.append(""); - buf.append(""); - buf.append(peer.getMTU()).append("").append(THINSP); - buf.append("").append(peer.getReceiveMTU()); + buf.append(""); + buf.append(peer.getMTU()).append("").append(THINSP); + buf.append("").append(peer.getReceiveMTU()); - //.append('/'); - //buf.append(peer.getMTUIncreases()).append('/'); - //buf.append(peer.getMTUDecreases()); - buf.append(""); + //.append('/'); + //buf.append(peer.getMTUIncreases()).append('/'); + //buf.append(peer.getMTUDecreases()); + buf.append(""); + } long sent = peer.getMessagesSent(); long recv = peer.getMessagesReceived(); @@ -681,19 +691,22 @@ public class PeerHelper extends HelperBase { buf.append("
" + "").append(DataHelper.formatDuration2(x)); x = offsetTotal/numPeers; - buf.append("").append(DataHelper.formatDuration2(x)).append("\n" + - ""); - buf.append(cwinTotal/(numPeers*1024) + "K"); - buf.append(" \n" + - ""); - if (numRTTPeers > 0) - buf.append(DataHelper.formatDuration2(rttTotal/numRTTPeers)); - else - buf.append("n/a"); - //buf.append(" "); - buf.append(""); - buf.append(DataHelper.formatDuration2(rtoTotal/numPeers)); - buf.append("").append(ut.getMTU(false)).append(""); + buf.append("").append(DataHelper.formatDuration2(x)).append("\n"); + if (isAdvanced) { + buf.append(""); + buf.append(cwinTotal/(numPeers*1024) + "K"); + buf.append(" \n" + + ""); + if (numRTTPeers > 0) + buf.append(DataHelper.formatDuration2(rttTotal/numRTTPeers)); + else + buf.append("n/a"); + //buf.append(" "); + buf.append(""); + buf.append(DataHelper.formatDuration2(rtoTotal/numPeers)); + buf.append("").append(ut.getMTU(false)).append(""); + } + buf.append(""); buf.append(sendTotal).append("").append(recvTotal).append("\n" + "").append(resentTotal); buf.append("").append(dupRecvTotal).append("\n");