Changeset c8b7e82


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

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

Files:
4 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>");
  • history.txt

    rcf1c0cb3 rc8b7e82  
     12019-02-26 zzz
     2 * SSU:
     3   - Fix scheduling of peer test at startup (ticket #2441)
     4   - Fix RTT/RTO calculations (ticket #2443)
     5
    162019-02-25 zzz
    27 * NetDB: Fix dup publish of RI at startup
     8 * NTCP: Fix number of SendFinisher threads (ticket #2438)
    39
    4102019-02-23 zzz
  • router/java/src/net/i2p/router/RouterVersion.java

    rcf1c0cb3 rc8b7e82  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 10;
     21    public final static long BUILD = 11;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/transport/udp/PeerState.java

    rcf1c0cb3 rc8b7e82  
    12381238            // first measurement
    12391239            _rtt = (int) lifetime;
    1240             _rttDeviation = (int)(lifetime / 2);
     1240            _rttDeviation = _rtt /  2;
    12411241        } else {
    12421242            // the rttDev calculation matches that recommended in RFC 2988 (beta = 1/4)
    1243             _rttDeviation = (int)( 0.75*_rttDeviation + 0.25*Math.abs(lifetime-_rtt) );
    1244        
    1245             float scale = RTT_DAMPENING;
    1246        
    1247             _rtt = (int)(_rtt*(1.0f-scale) + (scale)*lifetime);
     1243            _rttDeviation = (int)((0.75 * _rttDeviation) + (0.25 * Math.abs(lifetime - _rtt)));
     1244            _rtt = (int)((_rtt * (1.0f - RTT_DAMPENING)) + (RTT_DAMPENING * lifetime));
    12481245        }
    12491246        // K = 4
Note: See TracChangeset for help on using the changeset viewer.