From 581198ef541b30b0645c8b13fdec43cf59150d45 Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Mon, 24 Jun 2019 18:03:17 -0700 Subject: [PATCH] HBASE-22616 responseTooXXX logging for Multi should characterize the component ops (#329) Signed-off-by: Reid Chan Signed-off-by: Michael Stack --- .../apache/hadoop/hbase/ipc/RpcServer.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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 3ab63dd6e05b..84c78d60c7f1 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 @@ -517,6 +517,28 @@ void logResponse(Message param, String methodName, String call, String tag, } } } + if (param instanceof ClientProtos.MultiRequest) { + int numGets = 0; + int numMutations = 0; + int numServiceCalls = 0; + ClientProtos.MultiRequest multi = (ClientProtos.MultiRequest)param; + for (ClientProtos.RegionAction regionAction : multi.getRegionActionList()) { + for (ClientProtos.Action action: regionAction.getActionList()) { + if (action.hasMutation()) { + numMutations++; + } + if (action.hasGet()) { + numGets++; + } + if (action.hasServiceCall()) { + numServiceCalls++; + } + } + } + responseInfo.put("multi.gets", numGets); + responseInfo.put("multi.mutations", numMutations); + responseInfo.put("multi.servicecalls", numServiceCalls); + } LOG.warn("(response" + tag + "): " + GSON.toJson(responseInfo)); }