/** * On construction, adds the size of this call to the running count of outstanding call sizes. * Presumption is that we are put on a queue while we wait on an executor to run us. During this * time we occupy heap. */ // The constructor is shutdown so only RpcServer in this class can make one of these. CallRunner(final RpcServerInterface rpcServer, final RpcCall call) { this.call = call; this.rpcServer = rpcServer; // Add size of the call to queue size. if (call != null && rpcServer != null) { this.rpcServer.addCallSize(call.getSize()); } }
public Map<String, Long> getCallQueueSizeSummary() { HashMap<String, Long> callQueueMethodTotalSize = new HashMap<>(); for(BlockingQueue<CallRunner> queue: queues) { for (CallRunner cr:queue) { RpcCall rpcCall = cr.getRpcCall(); String method; if (null==rpcCall.getMethod() || StringUtil.isNullOrEmpty(method = rpcCall.getMethod().getName())) { method = "Unknown"; } long size = rpcCall.getSize(); callQueueMethodTotalSize.put(method, size+callQueueMethodTotalSize.getOrDefault(method, 0L)); } } return callQueueMethodTotalSize; }
} finally { if (!sucessful) { this.rpcServer.addCallSize(call.getSize() * -1);
protected void updateMethodCountAndSizeByQueue(BlockingQueue<Runnable> queue, HashMap<String, Long> methodCount, HashMap<String, Long> methodSize) { for (Runnable r : queue) { FifoCallRunner mcr = (FifoCallRunner) r; RpcCall rpcCall = mcr.getCallRunner().getRpcCall(); String method = getCallMethod(mcr.getCallRunner()); if (StringUtil.isNullOrEmpty(method)) { method = "Unknown"; } long size = rpcCall.getSize(); methodCount.put(method, 1 + methodCount.getOrDefault(method, 0L)); methodSize.put(method, size + methodSize.getOrDefault(method, 0L)); } }
long requestSize = call.getSize(); long responseSize = result.getSerializedSize(); if (call.isClientCellBlockSupported()) {