Changeset 5362e7cf


Ignore:
Timestamp:
Dec 5, 2011 4:17:29 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
0f384c8
Parents:
4c2c198c
Message:

comment out some stats

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java

    r4c2c198c r5362e7cf  
    3636    private final RouterContext _context;
    3737    private final Log _log;
     38    /** us */
    3839    private final Map<TunnelId, TunnelGateway> _outboundGateways;
    3940    private final Map<TunnelId, OutboundTunnelEndpoint> _outboundEndpoints;
     41    /** regular participant or IBEP of our own tunnel */
    4042    private final Map<TunnelId, TunnelParticipant> _participants;
     43    /** regular IBGW or our own zero-hop inbound */
    4144    private final Map<TunnelId, TunnelGateway> _inboundGateways;
    4245    private final Map<TunnelId, HopConfig> _participatingConfig;
     
    104107                                         "How many tunnels we join as the inbound gateway?", "Tunnels",
    105108                                         new long[] { 10*60*1000l, 60*60*1000l });
    106         ctx.statManager().createRateStat("tunnel.dispatchGatewayTime",
    107                                          "How long it takes to dispatch a TunnelGatewayMessage", "Tunnels",
    108                                          new long[] { 60*1000l, 60*60*1000l });
    109         ctx.statManager().createRateStat("tunnel.dispatchDataTime",
    110                                          "How long it takes to dispatch a TunnelDataMessage", "Tunnels",
    111                                          new long[] { 60*1000l, 60*60*1000l });
    112         ctx.statManager().createRateStat("tunnel.dispatchOutboundTime",
    113                                          "How long it takes to dispatch an outbound message", "Tunnels",
    114                                          new long[] { 60*1000l, 60*60*1000l });
    115         ctx.statManager().createRateStat("tunnel.dispatchOutboundZeroHopTime",
    116                                          "How long it takes to dispatch an outbound message through a zero hop tunnel", "Tunnels",
    117                                          new long[] { 60*60*1000l });
     109        //ctx.statManager().createRateStat("tunnel.dispatchGatewayTime",
     110        //                                 "How long it takes to dispatch a TunnelGatewayMessage", "Tunnels",
     111        //                                 new long[] { 60*1000l, 60*60*1000l });
     112        //ctx.statManager().createRateStat("tunnel.dispatchDataTime",
     113        //                                 "How long it takes to dispatch a TunnelDataMessage", "Tunnels",
     114        //                                 new long[] { 60*1000l, 60*60*1000l });
     115        //ctx.statManager().createRateStat("tunnel.dispatchOutboundTime",
     116        //                                 "How long it takes to dispatch an outbound message", "Tunnels",
     117        //                                 new long[] { 60*1000l, 60*60*1000l });
     118        //ctx.statManager().createRateStat("tunnel.dispatchOutboundZeroHopTime",
     119        //                                 "How long it takes to dispatch an outbound message through a zero hop tunnel", "Tunnels",
     120        //                                 new long[] { 60*60*1000l });
    118121        ctx.statManager().createRequiredRateStat("tunnel.participatingBandwidth",
    119122                                         "Participating traffic received (Bytes/sec)", "Tunnels",
     
    387390     */
    388391    public void dispatch(TunnelDataMessage msg, Hash recvFrom) {
    389         long before = System.currentTimeMillis();
     392        //long before = System.currentTimeMillis();
    390393        TunnelParticipant participant = _participants.get(msg.getTunnelIdObj());
    391394        if (participant != null) {
     
    409412                _context.statManager().addRateData("tunnel.dispatchEndpoint", 1);
    410413            } else {
     414                // Somewhat common, probably due to somebody with large clock skew?
    411415                _context.messageHistory().droppedTunnelDataMessageUnknown(msg.getUniqueId(), msg.getTunnelId());
    412416                int level = (_context.router().getUptime() > 10*60*1000 ? Log.WARN : Log.DEBUG);
     
    418422        }
    419423       
    420         long dispatchTime = System.currentTimeMillis() - before;
    421         if (_log.shouldLog(Log.DEBUG))
    422             _log.debug("Dispatch data time: " + dispatchTime + " participant? " + participant);
    423         _context.statManager().addRateData("tunnel.dispatchDataTime", dispatchTime, dispatchTime);
     424        //long dispatchTime = System.currentTimeMillis() - before;
     425        //if (_log.shouldLog(Log.DEBUG))
     426        //    _log.debug("Dispatch data time: " + dispatchTime + " participant? " + participant);
     427        //_context.statManager().addRateData("tunnel.dispatchDataTime", dispatchTime, dispatchTime);
    424428    }
    425429
     
    470474        }
    471475       
    472         long dispatchTime = _context.clock().now() - before;
    473        
    474         if (_log.shouldLog(Log.DEBUG))
    475             _log.debug("Dispatch in gw time: " + dispatchTime + " gateway? " + gw);
    476         _context.statManager().addRateData("tunnel.dispatchGatewayTime", dispatchTime, dispatchTime);
     476        //long dispatchTime = _context.clock().now() - before;
     477       
     478        //if (_log.shouldLog(Log.DEBUG))
     479        //    _log.debug("Dispatch in gw time: " + dispatchTime + " gateway? " + gw);
     480        //_context.statManager().addRateData("tunnel.dispatchGatewayTime", dispatchTime, dispatchTime);
    477481    }
    478482   
     
    545549        }
    546550       
    547         long dispatchTime = _context.clock().now() - before;
    548         if (dispatchTime > 1000) {
    549             if (_log.shouldLog(Log.WARN))
    550                 _log.warn("wtf, took " + dispatchTime + " to dispatch " + msg + " out " + outboundTunnel + " in " + gw);
    551         }
    552         if (gw instanceof TunnelGatewayZeroHop)
    553             _context.statManager().addRateData("tunnel.dispatchOutboundZeroHopTime", dispatchTime, dispatchTime);
    554         else
    555             _context.statManager().addRateData("tunnel.dispatchOutboundTime", dispatchTime, dispatchTime);
     551        //long dispatchTime = _context.clock().now() - before;
     552        //if (dispatchTime > 1000) {
     553        //    if (_log.shouldLog(Log.WARN))
     554        //        _log.warn("wtf, took " + dispatchTime + " to dispatch " + msg + " out " + outboundTunnel + " in " + gw);
     555        //}
     556        //if (gw instanceof TunnelGatewayZeroHop)
     557        //    _context.statManager().addRateData("tunnel.dispatchOutboundZeroHopTime", dispatchTime, dispatchTime);
     558        //else
     559        //    _context.statManager().addRateData("tunnel.dispatchOutboundTime", dispatchTime, dispatchTime);
    556560    }
    557561   
Note: See TracChangeset for help on using the changeset viewer.