Changeset c8b7e82 for apps


Ignore:
Timestamp:
Feb 26, 2019 5:38:34 PM (15 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
302adc2
Parents:
cf1c0cb3
Message:

Console: Handle zero SSU RTT on /peers (ticket #2443)
PeerState? minor cleanups

File:
1 edited

Legend:

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

    rcf1c0cb3 rc8b7e82  
    432432        long dupRecvTotal = 0;
    433433        int numPeers = 0;
     434        int numRTTPeers = 0;
    434435
    435436        StringBuilder buf = new StringBuilder(512);
     
    594595
    595596            buf.append("<td class=\"cells\" align=\"right\">");
    596             buf.append(DataHelper.formatDuration2(rtt));
     597            if (rtt > 0)
     598                buf.append(DataHelper.formatDuration2(rtt));
     599            else
     600                buf.append("n/a");
    597601            buf.append("</td>");
    598602
     
    652656            uptimeMsTotal += uptime;
    653657            cwinTotal += sendWindow;
    654             rttTotal += rtt;
     658            if (rtt > 0) {
     659                rttTotal += rtt;
     660                numRTTPeers++;
     661            }
    655662            rtoTotal += rto;
    656663
     
    680687        buf.append("</b></td><td>&nbsp;</td>\n" +
    681688                   "<td align=\"right\"><b>");
    682         buf.append(DataHelper.formatDuration2(rttTotal/numPeers));
     689        if (numRTTPeers > 0)
     690            buf.append(DataHelper.formatDuration2(rttTotal/numRTTPeers));
     691        else
     692            buf.append("n/a");
    683693        //buf.append("</b></td><td>&nbsp;</td><td align=\"center\"><b>");
    684694        buf.append("</b></td><td align=\"right\"><b>");
Note: See TracChangeset for help on using the changeset viewer.