hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1299084 - in /hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc: HBaseRpcMetrics.java HBaseServer.java
Date Fri, 09 Mar 2012 22:40:12 GMT
Author: stack
Date: Fri Mar  9 22:40:12 2012
New Revision: 1299084

URL: http://svn.apache.org/viewvc?rev=1299084&view=rev
Log:
HBASE-5538 A metric to measure the size of the response queue in the hbase rpc server

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java?rev=1299084&r1=1299083&r2=1299084&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java Fri Mar  9
22:40:12 2012
@@ -90,6 +90,8 @@ public class HBaseRpcMetrics implements 
           new MetricsIntValue("callQueueLen", registry);
   public final MetricsIntValue priorityCallQueueLen =
           new MetricsIntValue("priorityCallQueueLen", registry);
+  public final MetricsIntValue responseQueueLen =
+          new MetricsIntValue("responseQueueLen", registry);
   public final MetricsTimeVaryingInt authenticationFailures = 
           new MetricsTimeVaryingInt("rpcAuthenticationFailures", registry);
   public final MetricsTimeVaryingInt authenticationSuccesses =

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java?rev=1299084&r1=1299083&r2=1299084&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java Fri Mar  9 22:40:12
2012
@@ -203,6 +203,8 @@ public abstract class HBaseServer implem
 
   protected int highPriorityLevel;  // what level a high priority call is at
 
+  private volatile int responseQueueLen; // size of response queue for this server
+
   protected final List<Connection> connectionList =
     Collections.synchronizedList(new LinkedList<Connection>());
   //maintain a list
@@ -929,6 +931,7 @@ public abstract class HBaseServer implem
             return true;
           }
           if (!call.response.hasRemaining()) {
+            responseQueueLen--;
             call.connection.decRpcCount();
             //noinspection RedundantIfStatement
             if (numElements == 1) {    // last call fully processes.
@@ -998,6 +1001,7 @@ public abstract class HBaseServer implem
     void doRespond(Call call) throws IOException {
       // set the serve time when the response has to be sent later
       call.timestamp = System.currentTimeMillis();
+      responseQueueLen++;
 
       boolean doRegister = false;
       synchronized (call.connection.responseQueue) {
@@ -1287,6 +1291,7 @@ public abstract class HBaseServer implem
     } else {
       LOG.warn("Unknown call queue");
     }
+    rpcMetrics.responseQueueLen.set(responseQueueLen);
   }
 
   /** Handles queued calls . */



Mime
View raw message