add throttle stat

This commit is contained in:
zzz
2015-01-30 16:17:39 +00:00
parent 0671785ab2
commit 03f4ebbe35
2 changed files with 4 additions and 1 deletions

View File

@ -283,6 +283,7 @@ class EventPumper implements Runnable {
if (_log.shouldLog(Log.WARN))
_log.warn("EventPumper throttle " + loopCount + " loops in " +
(System.currentTimeMillis() - lastFailsafeIteration) + " ms");
_context.statManager().addRateData("ntcp.failsafeThrottle", 1);
try {
Thread.sleep(25);
} catch (InterruptedException ie) {}

View File

@ -122,6 +122,7 @@ public class NTCPTransport extends TransportImpl {
_context.statManager().createRateStat("ntcp.failsafeWrites", "How many times do we need to proactively add in an extra nio write to a peer at any given failsafe pass?", "ntcp", RATES);
_context.statManager().createRateStat("ntcp.failsafeCloses", "How many times do we need to proactively close an idle connection to a peer at any given failsafe pass?", "ntcp", RATES);
_context.statManager().createRateStat("ntcp.failsafeInvalid", "How many times do we close a connection to a peer to work around a JVM bug?", "ntcp", RATES);
_context.statManager().createRateStat("ntcp.failsafeThrottle", "Delay event pumper", "ntcp", RATES);
_context.statManager().createRateStat("ntcp.accept", "", "ntcp", RATES);
_context.statManager().createRateStat("ntcp.attemptBanlistedPeer", "", "ntcp", RATES);
_context.statManager().createRateStat("ntcp.attemptUnreachablePeer", "", "ntcp", RATES);
@ -245,7 +246,8 @@ public class NTCPTransport extends TransportImpl {
return;
}
if (isNew) {
con.send(msg); // doesn't do anything yet, just enqueues it
// doesn't do anything yet, just enqueues it
con.send(msg);
// As of 0.9.12, don't send our info if the first message is
// doing the same (common when connecting to a floodfill).
// Also, put the info message after whatever we are trying to send