Skip to content

Commit 32c135d

Browse files
Fantasy-Jayjay.zhu
andauthored
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 <jay.zhu@huolala.cn> Signed-off-by: Duo Zhang <zhangduo@apache.org>
1 parent 74fd5b2 commit 32c135d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ private void onCallFinished(Call call, HBaseRpcController hrc, Address addr,
379379
metrics.updateRpc(call.md, call.param, call.callStats);
380380
}
381381
if (LOG.isTraceEnabled()) {
382-
LOG.trace(
383-
"Call: " + call.md.getName() + ", callTime: " + call.callStats.getCallTimeMs() + "ms");
382+
LOG.trace("CallId: {}, call: {}, startTime: {}ms, callTime: {}ms", call.id, call.md.getName(),
383+
call.getStartTime(), call.callStats.getCallTimeMs());
384384
}
385385
if (call.error != null) {
386386
if (call.error instanceof RemoteException) {

hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,10 @@ public Pair<Message, CellScanner> call(RpcCall call, MonitoredRPCHandler status)
390390
int qTime = (int) (startTime - receiveTime);
391391
int totalTime = (int) (endTime - receiveTime);
392392
if (LOG.isTraceEnabled()) {
393-
LOG.trace(CurCall.get().toString() + ", response " + TextFormat.shortDebugString(result)
394-
+ " queueTime: " + qTime + " processingTime: " + processingTime + " totalTime: "
395-
+ totalTime);
393+
LOG.trace(
394+
"{}, response: {}, receiveTime: {}, queueTime: {}, processingTime: {}, totalTime: {}",
395+
CurCall.get().toString(), TextFormat.shortDebugString(result),
396+
CurCall.get().getReceiveTime(), qTime, processingTime, totalTime);
396397
}
397398
// Use the raw request call size for now.
398399
long requestSize = call.getSize();

0 commit comments

Comments
 (0)