Changeset b3cb094 for apps


Ignore:
Timestamp:
May 20, 2019 12:50:27 PM (19 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
7efb290f
Parents:
f543a45
Message:

Console: Hide some columns on SSU tab unless advanced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/PeerHelper.java

    rf543a45 rb3cb094  
    229229           .append("<tr><td><b id=\"def.rate\">").append(_t("In/Out")).append("</b></td><td>").append(_t("The smoothed inbound / outbound transfer rate (KBytes per second)")).append("</td></tr>\n")
    230230           .append("<tr><td><b id=\"def.up\">").append(_t("Up")).append("</b></td><td>").append(_t("How long ago this connection was established")).append("</td></tr>\n")
    231            .append("<tr><td><b id=\"def.skew\">").append(_t("Skew")).append("</b></td><td>").append(_t("The difference between the peer's clock and your own")).append("</td></tr>\n")
    232            .append("<tr><td><b id=\"def.cwnd\">CWND</b></td><td>").append(_t("The congestion window, which is how many bytes can be sent without an acknowledgement")).append(" /<br>\n")
     231           .append("<tr><td><b id=\"def.skew\">").append(_t("Skew")).append("</b></td><td>").append(_t("The difference between the peer's clock and your own")).append("</td></tr>\n");
     232        if (isAdvanced()) {
     233           buf.append("<tr><td><b id=\"def.cwnd\">CWND</b></td><td>").append(_t("The congestion window, which is how many bytes can be sent without an acknowledgement")).append(" /<br>\n")
    233234           .append(_t("The number of sent messages awaiting acknowledgement")).append(" /<br>\n")
    234235           .append(_t("The maximum number of concurrent messages to send")).append(" /<br>\n")
     
    238239           //.append("<tr><td><b id=\"def.dev\">").append(_t("Dev")).append("</b></td><td>").append(_t("The standard deviation of the round trip time in milliseconds")).append("</td></tr>\n")
    239240           .append("<tr><td><b id=\"def.rto\">RTO</b></td><td>").append(_t("The retransmit timeout in milliseconds")).append("</td></tr>\n")
    240            .append("<tr><td><b id=\"def.mtu\">MTU</b></td><td>").append(_t("Current maximum send packet size / estimated maximum receive packet size (bytes)")).append("</td></tr>\n")
    241            .append("<tr><td><b id=\"def.send\">").append(_t("TX")).append("</b></td><td>").append(_t("The total number of messages sent to the peer")).append("</td></tr>\n")
     241           .append("<tr><td><b id=\"def.mtu\">MTU</b></td><td>").append(_t("Current maximum send packet size / estimated maximum receive packet size (bytes)")).append("</td></tr>\n");
     242        }
     243        buf.append("<tr><td><b id=\"def.send\">").append(_t("TX")).append("</b></td><td>").append(_t("The total number of messages sent to the peer")).append("</td></tr>\n")
    242244           .append("<tr><td><b id=\"def.recv\">").append(_t("RX")).append("</b></td><td>").append(_t("The total number of messages received from the peer")).append("</td></tr>\n")
    243245           .append("<tr><td><b id=\"def.resent\">").append(_t("Dup TX")).append("</b></td><td>").append(_t("The total number of packets retransmitted to the peer")).append("</td></tr>\n")
     
    438440        buf.append(". ").append(_t("Limit")).append(": ").append(ut.getMaxConnections());
    439441        //buf.append(". ").append(_t("Timeout")).append(": ").append(DataHelper.formatDuration2(_expireTimeout));
    440         if (isAdvanced()) {
     442        final boolean isAdvanced = isAdvanced();
     443        if (isAdvanced) {
    441444            buf.append(". ").append(_t("Status")).append(": ").append(_t(ut.getReachabilityStatus().toStatusString()));
    442445        }
     
    464467        appendSortLinks(buf, urlBase, sortFlags, _t("Sort by clock skew"), FLAG_SKEW);
    465468        buf.append("</span></th>\n");
    466         buf.append("<th nowrap><a href=\"#def.cwnd\">CWND</a><br>");
    467         appendSortLinks(buf, urlBase, sortFlags, _t("Sort by congestion window"), FLAG_CWND);
    468         buf.append("</th><th nowrap><span class=\"peersort\"><a href=\"#def.ssthresh\">SST</a><br>");
    469         appendSortLinks(buf, urlBase, sortFlags, _t("Sort by slow start threshold"), FLAG_SSTHRESH);
    470         buf.append("</span></th>\n");
    471         buf.append("<th nowrap><span class=\"peersort\"><a href=\"#def.rtt\">RTT</a><br>");
    472         appendSortLinks(buf, urlBase, sortFlags, _t("Sort by round trip time"), FLAG_RTT);
    473         //buf.append("</th><th nowrap><a href=\"#def.dev\">").append(_t("Dev")).append("</a><br>");
    474         //appendSortLinks(buf, urlBase, sortFlags, _t("Sort by round trip time deviation"), FLAG_DEV);
    475         buf.append("</span></th><th nowrap><span class=\"peersort\"><a href=\"#def.rto\">RTO</a><br>");
    476         appendSortLinks(buf, urlBase, sortFlags, _t("Sort by retransmission timeout"), FLAG_RTO);
    477         buf.append("</span></th>\n");
    478         buf.append("<th nowrap><a href=\"#def.mtu\">MTU</a><br>");
    479         appendSortLinks(buf, urlBase, sortFlags, _t("Sort by outbound maximum transmit unit"), FLAG_MTU);
    480         buf.append("</th><th nowrap><span class=\"peersort\"><a href=\"#def.send\">").append(_t("TX")).append("</a><br>");
     469        if (isAdvanced) {
     470            buf.append("<th nowrap><a href=\"#def.cwnd\">CWND</a><br>");
     471            appendSortLinks(buf, urlBase, sortFlags, _t("Sort by congestion window"), FLAG_CWND);
     472            buf.append("</th><th nowrap><span class=\"peersort\"><a href=\"#def.ssthresh\">SST</a><br>");
     473            appendSortLinks(buf, urlBase, sortFlags, _t("Sort by slow start threshold"), FLAG_SSTHRESH);
     474            buf.append("</span></th>\n");
     475            buf.append("<th nowrap><span class=\"peersort\"><a href=\"#def.rtt\">RTT</a><br>");
     476            appendSortLinks(buf, urlBase, sortFlags, _t("Sort by round trip time"), FLAG_RTT);
     477            //buf.append("</th><th nowrap><a href=\"#def.dev\">").append(_t("Dev")).append("</a><br>");
     478            //appendSortLinks(buf, urlBase, sortFlags, _t("Sort by round trip time deviation"), FLAG_DEV);
     479            buf.append("</span></th><th nowrap><span class=\"peersort\"><a href=\"#def.rto\">RTO</a><br>");
     480            appendSortLinks(buf, urlBase, sortFlags, _t("Sort by retransmission timeout"), FLAG_RTO);
     481            buf.append("</span></th>\n");
     482            buf.append("<th nowrap><a href=\"#def.mtu\">MTU</a><br>");
     483            appendSortLinks(buf, urlBase, sortFlags, _t("Sort by outbound maximum transmit unit"), FLAG_MTU);
     484            buf.append("</th>");
     485        }
     486        buf.append("<th nowrap><span class=\"peersort\"><a href=\"#def.send\">").append(_t("TX")).append("</a><br>");
    481487        appendSortLinks(buf, urlBase, sortFlags, _t("Sort by packets sent"), FLAG_SEND);
    482488        buf.append("</span></th><th nowrap><span class=\"peersort\"><a href=\"#def.recv\">").append(_t("RX")).append("</a><br>");
     
    577583            long sendWindow = peer.getSendWindowBytes();
    578584
    579             buf.append("<td class=\"cells cwnd\" align=\"center\"><span class=\"right\">");
    580             buf.append(sendWindow/1024);
    581             buf.append("K");
    582             buf.append("</span>").append(THINSP).append("<span class=\"right\">").append(peer.getConcurrentSends());
    583             buf.append("</span>").append(THINSP).append("<span class=\"right\">").append(peer.getConcurrentSendWindow());
    584             buf.append("</span>").append(THINSP).append("<span class=\"left\">").append(peer.getConsecutiveSendRejections());
    585             if (peer.isBacklogged())
    586                 buf.append(' ').append(_t("backlogged"));
    587             buf.append("</span></td>");
    588 
    589             buf.append("<td class=\"cells\" align=\"right\">");
    590             buf.append(peer.getSlowStartThreshold()/1024);
    591             buf.append("K</td>");
    592 
    593             int rtt = peer.getRTT();
    594             int rto = peer.getRTO();
    595 
    596             buf.append("<td class=\"cells\" align=\"right\">");
    597             if (rtt > 0)
    598                 buf.append(DataHelper.formatDuration2(rtt));
    599             else
    600                 buf.append("n/a");
    601             buf.append("</td>");
    602 
    603             //buf.append("<td class=\"cells\" align=\"right\">");
    604             //buf.append(DataHelper.formatDuration2(peer.getRTTDeviation()));
    605             //buf.append("</td>");
    606 
    607             buf.append("<td class=\"cells\" align=\"right\">");
    608             buf.append(DataHelper.formatDuration2(rto));
    609             buf.append("</td>");
    610 
    611             buf.append("<td class=\"cells\" align=\"center\"><span class=\"right\">");
    612             buf.append(peer.getMTU()).append("</span>").append(THINSP);
    613             buf.append("<span class=\"left\">").append(peer.getReceiveMTU());
    614 
    615             //.append('/');
    616             //buf.append(peer.getMTUIncreases()).append('/');
    617             //buf.append(peer.getMTUDecreases());
    618             buf.append("</span></td>");
     585            int rtt = 0;
     586            int rto = 0;
     587            if (isAdvanced) {
     588                buf.append("<td class=\"cells cwnd\" align=\"center\"><span class=\"right\">");
     589                buf.append(sendWindow/1024);
     590                buf.append("K");
     591                buf.append("</span>").append(THINSP).append("<span class=\"right\">").append(peer.getConcurrentSends());
     592                buf.append("</span>").append(THINSP).append("<span class=\"right\">").append(peer.getConcurrentSendWindow());
     593                buf.append("</span>").append(THINSP).append("<span class=\"left\">").append(peer.getConsecutiveSendRejections());
     594                if (peer.isBacklogged())
     595                    buf.append(' ').append(_t("backlogged"));
     596                buf.append("</span></td>");
     597
     598                buf.append("<td class=\"cells\" align=\"right\">");
     599                buf.append(peer.getSlowStartThreshold()/1024);
     600                buf.append("K</td>");
     601
     602                rtt = peer.getRTT();
     603                rto = peer.getRTO();
     604
     605                buf.append("<td class=\"cells\" align=\"right\">");
     606                if (rtt > 0)
     607                    buf.append(DataHelper.formatDuration2(rtt));
     608                else
     609                    buf.append("n/a");
     610                buf.append("</td>");
     611
     612                //buf.append("<td class=\"cells\" align=\"right\">");
     613                //buf.append(DataHelper.formatDuration2(peer.getRTTDeviation()));
     614                //buf.append("</td>");
     615
     616                buf.append("<td class=\"cells\" align=\"right\">");
     617                buf.append(DataHelper.formatDuration2(rto));
     618                buf.append("</td>");
     619
     620                buf.append("<td class=\"cells\" align=\"center\"><span class=\"right\">");
     621                buf.append(peer.getMTU()).append("</span>").append(THINSP);
     622                buf.append("<span class=\"left\">").append(peer.getReceiveMTU());
     623
     624                //.append('/');
     625                //buf.append(peer.getMTUIncreases()).append('/');
     626                //buf.append(peer.getMTUDecreases());
     627                buf.append("</span></td>");
     628            }
    619629
    620630            long sent = peer.getMessagesSent();
     
    682692                   "<td align=\"right\"><b>").append(DataHelper.formatDuration2(x));
    683693        x = offsetTotal/numPeers;
    684         buf.append("</b></td><td align=\"right\"><b>").append(DataHelper.formatDuration2(x)).append("</b></td>\n" +
    685                    "<td align=\"center\"><b>");
    686         buf.append(cwinTotal/(numPeers*1024) + "K");
    687         buf.append("</b></td><td>&nbsp;</td>\n" +
    688                    "<td align=\"right\"><b>");
    689         if (numRTTPeers > 0)
    690             buf.append(DataHelper.formatDuration2(rttTotal/numRTTPeers));
    691         else
    692             buf.append("n/a");
    693         //buf.append("</b></td><td>&nbsp;</td><td align=\"center\"><b>");
    694         buf.append("</b></td><td align=\"right\"><b>");
    695         buf.append(DataHelper.formatDuration2(rtoTotal/numPeers));
    696         buf.append("</b></td><td align=\"center\"><b>").append(ut.getMTU(false)).append("</b></td><td align=\"right\"><b>");
     694        buf.append("</b></td><td align=\"right\"><b>").append(DataHelper.formatDuration2(x)).append("</b></td>\n");
     695        if (isAdvanced) {
     696            buf.append("<td align=\"center\"><b>");
     697            buf.append(cwinTotal/(numPeers*1024) + "K");
     698            buf.append("</b></td><td>&nbsp;</td>\n" +
     699                       "<td align=\"right\"><b>");
     700            if (numRTTPeers > 0)
     701                buf.append(DataHelper.formatDuration2(rttTotal/numRTTPeers));
     702            else
     703                buf.append("n/a");
     704            //buf.append("</b></td><td>&nbsp;</td><td align=\"center\"><b>");
     705            buf.append("</b></td><td align=\"right\"><b>");
     706            buf.append(DataHelper.formatDuration2(rtoTotal/numPeers));
     707            buf.append("</b></td><td align=\"center\"><b>").append(ut.getMTU(false)).append("</b></td>");
     708        }
     709        buf.append("<td align=\"right\"><b>");
    697710        buf.append(sendTotal).append("</b></td><td align=\"right\"><b>").append(recvTotal).append("</b></td>\n" +
    698711                   "<td align=\"right\"><b>").append(resentTotal);
Note: See TracChangeset for help on using the changeset viewer.