Changeset 2332ac2


Ignore:
Timestamp:
Oct 6, 2011 4:06:25 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
0c3f84c
Parents:
a670100
Message:
  • Transport: Add per-style send processing time stat
File:
1 edited

Legend:

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

    ra670100 r2332ac2  
    4545 */
    4646public abstract class TransportImpl implements Transport {
    47     private Log _log;
     47    private final Log _log;
    4848    private TransportEventListener _listener;
    4949    private RouterAddress _currentAddress;
    5050    private final List _sendPool;
    51     protected RouterContext _context;
     51    protected final RouterContext _context;
    5252    /** map from routerIdentHash to timestamp (Long) that the peer was last unreachable */
    5353    private final Map<Hash, Long>  _unreachableEntries;
    54     private Set<Hash> _wasUnreachableEntries;
     54    private final Set<Hash> _wasUnreachableEntries;
    5555    /** global router ident -> IP */
    56     private static Map<Hash, byte[]> _IPMap = new ConcurrentHashMap(128);
     56    private static final Map<Hash, byte[]> _IPMap = new ConcurrentHashMap(128);
    5757
    5858    /**
     
    7070        _context.statManager().createRateStat("transport.receiveMessageTimeSlow", "How long it takes to read a message (when it takes more than a second)?", "Transport", new long[] { 60*1000l, 5*60*1000l, 10*60*1000l, 60*60*1000l, 24*60*60*1000l });
    7171        _context.statManager().createRequiredRateStat("transport.sendProcessingTime", "Time to process and send a message (ms)", "Transport", new long[] { 60*1000l, 10*60*1000l, 60*60*1000l, 24*60*60*1000l });
     72        _context.statManager().createRateStat("transport.sendProcessingTime." + getStyle(), "Time to process and send a message (ms)", "Transport", new long[] { 60*1000l });
    7273        _context.statManager().createRateStat("transport.expiredOnQueueLifetime", "How long a message that expires on our outbound queue is processed", "Transport", new long[] { 60*1000l, 10*60*1000l, 60*60*1000l, 24*60*60*1000l } );
    7374        _sendPool = new ArrayList(16);
    7475        _unreachableEntries = new HashMap(16);
    7576        _wasUnreachableEntries = new ConcurrentHashSet(16);
    76         _currentAddress = null;
    7777        SimpleScheduler.getInstance().addPeriodicEvent(new CleanupUnreachable(), 2 * UNREACHABLE_PERIOD, UNREACHABLE_PERIOD / 2);
    7878    }
     
    319319        if (sendSuccessful) {
    320320            _context.statManager().addRateData("transport.sendProcessingTime", lifetime, lifetime);
     321            _context.statManager().addRateData("transport.sendProcessingTime." + getStyle(), lifetime, 0);
    321322            _context.profileManager().messageSent(msg.getTarget().getIdentity().getHash(), getStyle(), sendTime, msg.getMessageSize());
    322323            _context.statManager().addRateData("transport.sendMessageSize", msg.getMessageSize(), sendTime);
Note: See TracChangeset for help on using the changeset viewer.