|
@@ -498,6 +498,7 @@ public abstract class Server {
|
|
private Map<Integer, Listener> auxiliaryListenerMap;
|
|
private Map<Integer, Listener> auxiliaryListenerMap;
|
|
private Responder responder = null;
|
|
private Responder responder = null;
|
|
private Handler[] handlers = null;
|
|
private Handler[] handlers = null;
|
|
|
|
+ private final AtomicInteger numInProcessHandler = new AtomicInteger();
|
|
|
|
|
|
private boolean logSlowRPC = false;
|
|
private boolean logSlowRPC = false;
|
|
|
|
|
|
@@ -509,6 +510,10 @@ public abstract class Server {
|
|
return logSlowRPC;
|
|
return logSlowRPC;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public int getNumInProcessHandler() {
|
|
|
|
+ return numInProcessHandler.get();
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Sets slow RPC flag.
|
|
* Sets slow RPC flag.
|
|
* @param logSlowRPCFlag
|
|
* @param logSlowRPCFlag
|
|
@@ -3080,6 +3085,7 @@ public abstract class Server {
|
|
|
|
|
|
try {
|
|
try {
|
|
call = callQueue.take(); // pop the queue; maybe blocked here
|
|
call = callQueue.take(); // pop the queue; maybe blocked here
|
|
|
|
+ numInProcessHandler.incrementAndGet();
|
|
startTimeNanos = Time.monotonicNowNanos();
|
|
startTimeNanos = Time.monotonicNowNanos();
|
|
if (alignmentContext != null && call.isCallCoordinated() &&
|
|
if (alignmentContext != null && call.isCallCoordinated() &&
|
|
call.getClientStateId() > alignmentContext.getLastSeenStateId()) {
|
|
call.getClientStateId() > alignmentContext.getLastSeenStateId()) {
|
|
@@ -3133,6 +3139,7 @@ public abstract class Server {
|
|
}
|
|
}
|
|
} finally {
|
|
} finally {
|
|
CurCall.set(null);
|
|
CurCall.set(null);
|
|
|
|
+ numInProcessHandler.decrementAndGet();
|
|
IOUtils.cleanupWithLogger(LOG, traceScope);
|
|
IOUtils.cleanupWithLogger(LOG, traceScope);
|
|
if (call != null) {
|
|
if (call != null) {
|
|
updateMetrics(call, startTimeNanos, connDropped);
|
|
updateMetrics(call, startTimeNanos, connDropped);
|