hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject [03/50] hbase git commit: HBASE-15083 Gets from Multiactions are not counted in metrics for gets
Date Tue, 01 Nov 2016 19:50:57 GMT
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/556741b9
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/556741b9
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/556741b9

Branch: refs/heads/branch-1.0
Commit: 556741b9ea031edadd982e098ee36ee88dd0df62
Parents: f4fa859
Author: chenheng <chenheng@apache.org>
Authored: Tue Jan 12 14:32:55 2016 +0800
Committer: chenheng <chenheng@apache.org>
Committed: Tue Jan 12 14:32:55 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/556741b9/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 9c6de0f..2af42fe 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
@@ -541,8 +541,16 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
       try {
         Result r = null;
         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