From 8a10dbf6c469099f352b54ae73c3d829cc6b976e Mon Sep 17 00:00:00 2001 From: Fantasy-Jay <875282031@qq.com> Date: Sat, 20 Aug 2022 20:50:40 +0800 Subject: [PATCH] HBASE-27268 In trace log mode, the client does not print callId/startTime and the server does not print receiveTime (#4710) Co-authored-by: jay.zhu Signed-off-by: Duo Zhang (cherry picked from commit 32c135d8a552970e592ed39735186b4364f85ed1) --- .../org/apache/hadoop/hbase/ipc/AbstractRpcClient.java | 4 ++-- .../main/java/org/apache/hadoop/hbase/ipc/RpcServer.java | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java index e5863948a58..0afd07d7951 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java @@ -379,8 +379,8 @@ public abstract class AbstractRpcClient implements RpcC metrics.updateRpc(call.md, call.param, call.callStats); } if (LOG.isTraceEnabled()) { - LOG.trace( - "Call: " + call.md.getName() + ", callTime: " + call.callStats.getCallTimeMs() + "ms"); + LOG.trace("CallId: {}, call: {}, startTime: {}ms, callTime: {}ms", call.id, call.md.getName(), + call.getStartTime(), call.callStats.getCallTimeMs()); } if (call.error != null) { if (call.error instanceof RemoteException) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java index 2ca86f57f74..66d5b8f43d8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java @@ -390,9 +390,10 @@ public abstract class RpcServer implements RpcServerInterface, ConfigurationObse int qTime = (int) (startTime - receiveTime); int totalTime = (int) (endTime - receiveTime); if (LOG.isTraceEnabled()) { - LOG.trace(CurCall.get().toString() + ", response " + TextFormat.shortDebugString(result) - + " queueTime: " + qTime + " processingTime: " + processingTime + " totalTime: " - + totalTime); + LOG.trace( + "{}, response: {}, receiveTime: {}, queueTime: {}, processingTime: {}, totalTime: {}", + CurCall.get().toString(), TextFormat.shortDebugString(result), + CurCall.get().getReceiveTime(), qTime, processingTime, totalTime); } // Use the raw request call size for now. long requestSize = call.getSize();