lets keep track of how many messages die on our queue due to us being slow

This commit is contained in:
jrandom
2004-06-26 21:07:07 +00:00
committed by zzz
parent 9b4899da07
commit 7e2227ad42

View File

@ -53,6 +53,7 @@ public class HandleTunnelMessageJob extends JobImpl {
ctx.statManager().createRateStat("tunnel.gatewayMessageSize", "How large are the messages we are forwarding on as an inbound gateway?", "Tunnels", new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l }); ctx.statManager().createRateStat("tunnel.gatewayMessageSize", "How large are the messages we are forwarding on as an inbound gateway?", "Tunnels", new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l });
ctx.statManager().createRateStat("tunnel.relayMessageSize", "How large are the messages we are forwarding on as a participant in a tunnel?", "Tunnels", new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l }); ctx.statManager().createRateStat("tunnel.relayMessageSize", "How large are the messages we are forwarding on as a participant in a tunnel?", "Tunnels", new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l });
ctx.statManager().createRateStat("tunnel.endpointMessageSize", "How large are the messages we are forwarding in as an outbound endpoint?", "Tunnels", new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l }); ctx.statManager().createRateStat("tunnel.endpointMessageSize", "How large are the messages we are forwarding in as an outbound endpoint?", "Tunnels", new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l });
ctx.statManager().createRateStat("tunnel.expiredAfterAcceptTime", "How long after expiration do we finally start running an expired tunnel message?", "Tunnels", new long[] { 10*60*1000l, 60*60*1000l, 24*60*60*1000l });
_message = msg; _message = msg;
_from = from; _from = from;
_fromHash = fromHash; _fromHash = fromHash;
@ -62,12 +63,15 @@ public class HandleTunnelMessageJob extends JobImpl {
public void runJob() { public void runJob() {
TunnelId id = _message.getTunnelId(); TunnelId id = _message.getTunnelId();
if (_context.clock().now() >= _message.getMessageExpiration().getTime()) { long excessLag = _context.clock().now() - _message.getMessageExpiration().getTime();
if (excessLag > 0) {
// expired while on the queue
if (_log.shouldLog(Log.ERROR)) if (_log.shouldLog(Log.ERROR))
_log.error("Accepted message (" + _message.getUniqueId() + ") expired on the queue for tunnel " _log.error("Accepted message (" + _message.getUniqueId() + ") expired on the queue for tunnel "
+ id.getTunnelId() + " expiring " + id.getTunnelId() + " expiring "
+ (_context.clock().now() - _message.getMessageExpiration().getTime()) + (_context.clock().now() - _message.getMessageExpiration().getTime())
+ "ms agp"); + "ms agp");
_context.statManager().addRateData("tunnel.expiredAfterAcceptTime", excessLag, excessLag);
_context.messageHistory().messageProcessingError(_message.getUniqueId(), _context.messageHistory().messageProcessingError(_message.getUniqueId(),
TunnelMessage.class.getName(), TunnelMessage.class.getName(),
"tunnel message expired on the queue"); "tunnel message expired on the queue");