You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2019/06/25 02:15:12 UTC

[hbase] branch branch-2.1 updated: HBASE-22616 responseTooXXX logging for Multi should characterize the component ops (#329)

This is an automated email from the ASF dual-hosted git repository.

apurtell pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new a1aab95  HBASE-22616 responseTooXXX logging for Multi should characterize the component ops (#329)
a1aab95 is described below

commit a1aab9514f76c195d592f4420469314a0c8589be
Author: Andrew Purtell <ap...@apache.org>
AuthorDate: Mon Jun 24 18:03:17 2019 -0700

    HBASE-22616 responseTooXXX logging for Multi should characterize the component ops (#329)
    
    Signed-off-by: Reid Chan <re...@apache.org>
    Signed-off-by: Michael Stack <st...@apache.org>
---
 .../org/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 0207b03..f3fab68 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 @@ public abstract class RpcServer implements RpcServerInterface,
         }
       }
     }
+    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 + "): " + MAPPER.writeValueAsString(responseInfo));
   }