hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenh...@apache.org
Subject hbase git commit: HBASE-15083 Gets from Multiactions are not counted in metrics for gets
Date Tue, 12 Jan 2016 06:39:31 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 4b59f62c2 -> c1d916d83


HBASE-15083 Gets from Multiactions are not counted in metrics for gets


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/c1d916d8
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/c1d916d8
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/c1d916d8

Branch: refs/heads/branch-1.2
Commit: c1d916d83fad74801a77de3d0e77aa8db721b85f
Parents: 4b59f62
Author: chenheng <chenheng@apache.org>
Authored: Tue Jan 12 14:32:55 2016 +0800
Committer: chenheng <chenheng@apache.org>
Committed: Tue Jan 12 14:38:47 2016 +0800

----------------------------------------------------------------------
 .../apache/hadoop/hbase/regionserver/RSRpcServices.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c1d916d8/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index f6a60db..db0f0e3 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -619,8 +619,16 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
           continue;
         }
         if (action.hasGet()) {
-          Get get = ProtobufUtil.toGet(action.getGet());
-          r = region.get(get);
+          long before = EnvironmentEdgeManager.currentTime();
+          try {
+            Get get = ProtobufUtil.toGet(action.getGet());
+            r = region.get(get);
+          } finally {
+            if (regionServer.metricsRegionServer != null) {
+              regionServer.metricsRegionServer.updateGet(
+                EnvironmentEdgeManager.currentTime() - before);
+            }
+          }
         } else if (action.hasServiceCall()) {
           resultOrExceptionBuilder = ResultOrException.newBuilder();
           try {


Mime
View raw message