Changeset e5bcfe4


Ignore:
Timestamp:
Nov 9, 2016 9:08:21 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
24ecc85
Parents:
e614b099
Message:

Transport: Add stats for inbound v4/v6 connections (ticket #1854)

Location:
router/java/src/net/i2p/router/transport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java

    re614b099 re5bcfe4  
    151151        _context.statManager().createRateStat("ntcp.inboundEstablished", "", "ntcp", RATES);
    152152        _context.statManager().createRateStat("ntcp.inboundEstablishedDuplicate", "", "ntcp", RATES);
     153        _context.statManager().createRateStat("ntcp.inboundIPv4Conn", "Inbound IPv4 NTCP Connection", "ntcp", RATES);
     154        _context.statManager().createRateStat("ntcp.inboundIPv6Conn", "Inbound IPv6 NTCP Connection", "ntcp", RATES);
    153155        //_context.statManager().createRateStat("ntcp.infoMessageEnqueued", "", "ntcp", RATES);
    154156        //_context.statManager().createRateStat("ntcp.floodInfoMessageEnqueued", "", "ntcp", RATES);
     
    214216            old = _conByIdent.put(peer, con);
    215217        }
    216         if (con.isIPv6())
     218        if (con.isIPv6()) {
    217219            _lastInboundIPv6 = con.getCreated();
    218         else
     220            _context.statManager().addRateData("ntcp.inboundIPv6Conn", 1);
     221        } else {
    219222            _lastInboundIPv4 = con.getCreated();
     223            _context.statManager().addRateData("ntcp.inboundIPv4Conn", 1);
     224        }
    220225        return old;
    221226    }
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    re614b099 re5bcfe4  
    290290        _context.statManager().createRateStat("udp.dropPeerDroplist", "How many peers currently have their packets dropped outright when a new peer is added to the list?", "udp", RATES);
    291291        _context.statManager().createRateStat("udp.dropPeerConsecutiveFailures", "How many consecutive failed sends to a peer did we attempt before giving up and reestablishing a new session (lifetime is inactivity perood)", "udp", RATES);
     292        _context.statManager().createRateStat("udp.inboundIPv4Conn", "Inbound IPv4 UDP Connection", "udp", RATES);
     293        _context.statManager().createRateStat("udp.inboundIPv6Conn", "Inbound IPv4 UDP Connection", "udp", RATES);
    292294        // following are for PacketBuider
    293295        //_context.statManager().createRateStat("udp.packetAuthTime", "How long it takes to encrypt and MAC a packet for sending", "udp", RATES);
     
    781783        if (isIPv6) {
    782784            _lastInboundIPv6 = _context.clock().now();
     785            _context.statManager().addRateData("udp.inboundIPv6Conn", 1);
    783786            // former workaround for lack of IPv6 peer testing
    784787            //if (_currentOurV6Address != null)
     
    789792            // use OS clock since its an ordering thing, not a time thing
    790793            _lastInboundReceivedOn = System.currentTimeMillis();
     794            _context.statManager().addRateData("udp.inboundIPv4Conn", 1);
    791795        }
    792796    }
Note: See TracChangeset for help on using the changeset viewer.