hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbau...@apache.org
Subject svn commit: r1378320 - in /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase: ./ ipc/ metrics/ regionserver/metrics/
Date Tue, 28 Aug 2012 20:46:04 GMT
Author: mbautin
Date: Tue Aug 28 20:46:03 2012
New Revision: 1378320

URL: http://svn.apache.org/viewvc?rev=1378320&view=rev
Log:
Revert D530335 [HBASE-6235] Reset the max and min for the time varying metrics in HBase

Author: liyintang

Summary:
Revert: D530335 ([HBASE-6235] Reset the max and min for the time varying metrics in HBase
) in hbase trunk as well.

Because the D482541 hasn't committed in the alligator branch and we want to build hbase-trunk
with alligator for shadow testing.

Test Plan: Not tested

Reviewers: kannan, hkuang, pritam, aaiyer

Reviewed By: kannan

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D544220

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/HConstants.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPC.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerDynamicMetrics.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/HConstants.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/HConstants.java?rev=1378320&r1=1378319&r2=1378320&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/HConstants.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/HConstants.java Tue Aug 28
20:46:03 2012
@@ -564,14 +564,6 @@ public final class HConstants {
 
   public static final int IPC_CALL_PARAMETER_LENGTH_MAX = 1000;
 
-  /** The metric name for RpcQueueTime */
-  public static final String RPC_QUEUE_TIME = "RpcQueueTime";
-  
-  /** The metric name for RpcProcessingTime */
-  public static final String RPC_PROCESS_TIME = "RpcProcessingTime";
-  
-  public static final boolean RESET_MINMAX = true;
-  
   private HConstants() {
     // Can't be instantiated with this ctor.
   }

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPC.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPC.java?rev=1378320&r1=1378319&r2=1378320&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPC.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPC.java Tue Aug
28 20:46:03 2012
@@ -589,8 +589,8 @@ public class HBaseRPC {
             " queueTime= " + qTime +
             " procesingTime= " + processingTime);
         }
-        rpcMetrics.inc(HConstants.RPC_QUEUE_TIME, qTime);
-        rpcMetrics.inc(HConstants.RPC_PROCESS_TIME, processingTime);
+        rpcMetrics.rpcQueueTime.inc(qTime);
+        rpcMetrics.rpcProcessingTime.inc(processingTime);
         rpcMetrics.inc(call.getMethodName(), processingTime);
         if (verbose) trace("Return: " + value);
 

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java?rev=1378320&r1=1378319&r2=1378320&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java
Tue Aug 28 20:46:03 2012
@@ -22,12 +22,10 @@ package org.apache.hadoop.hbase.ipc;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.metrics.MetricsContext;
 import org.apache.hadoop.metrics.MetricsRecord;
 import org.apache.hadoop.metrics.MetricsUtil;
 import org.apache.hadoop.metrics.Updater;
-import org.apache.hadoop.metrics.util.MetricsBase;
 import org.apache.hadoop.metrics.util.MetricsRegistry;
 import org.apache.hadoop.metrics.util.MetricsTimeVaryingRate;
 
@@ -48,6 +46,21 @@ public class HBaseRpcMetrics implements 
   private static Log LOG = LogFactory.getLog(HBaseRpcMetrics.class);
   private final HBaseRPCStatistics rpcStatistics;
 
+  public HBaseRpcMetrics(String hostName, String port) {
+    MetricsContext context = MetricsUtil.getContext("rpc");
+    metricsRecord = MetricsUtil.createRecord(context, "metrics");
+
+    metricsRecord.setTag("port", port);
+
+    LOG.info("Initializing RPC Metrics with hostName="
+        + hostName + ", port=" + port);
+
+    context.registerUpdater(this);
+
+    rpcStatistics = new HBaseRPCStatistics(this.registry, hostName, port);
+  }
+
+
   /**
    * The metrics variables are public:
    *  - they can be set directly by calling their set/inc methods
@@ -55,25 +68,17 @@ public class HBaseRpcMetrics implements 
    */
   public final MetricsRegistry registry = new MetricsRegistry();
 
-  public HBaseRpcMetrics(String hostName, String port) {
-    this.create(HConstants.RPC_QUEUE_TIME);
-    this.create(HConstants.RPC_PROCESS_TIME);
-    
-    MetricsContext context = MetricsUtil.getContext("rpc");
-    metricsRecord = MetricsUtil.createRecord(context, "metrics");
-    metricsRecord.setTag("port", port);
-    LOG.info("Initializing RPC Metrics with hostName="  + hostName + ", port=" + port);
-    rpcStatistics = new HBaseRPCStatistics(this.registry, hostName, port);
-    
-    context.registerUpdater(this);
-  }
+  public MetricsTimeVaryingRate rpcQueueTime = new MetricsTimeVaryingRate("RpcQueueTime",
registry);
+  public MetricsTimeVaryingRate rpcProcessingTime = new MetricsTimeVaryingRate("RpcProcessingTime",
registry);
+
+  //public Map <String, MetricsTimeVaryingRate> metricsList = Collections.synchronizedMap(new
HashMap<String, MetricsTimeVaryingRate>());
+
 
   private MetricsTimeVaryingRate get(String key) {
     return (MetricsTimeVaryingRate) registry.get(key);
   }
   private MetricsTimeVaryingRate create(String key) {
-    return new MetricsTimeVaryingRate(key, this.registry, MetricsBase.NO_DESCRIPTION,
-        HConstants.RESET_MINMAX);
+    return new MetricsTimeVaryingRate(key, this.registry);
   }
 
   public synchronized void inc(String name, int amt) {
@@ -89,10 +94,15 @@ public class HBaseRpcMetrics implements 
    * @param context ctx
    */
   public void doUpdates(MetricsContext context) {
+    rpcQueueTime.pushMetric(metricsRecord);
+    rpcProcessingTime.pushMetric(metricsRecord);
+
     synchronized (registry) {
       // Iterate through the registry to propagate the different rpc metrics.
+
       for (String metricName : registry.getKeyList() ) {
         MetricsTimeVaryingRate value = (MetricsTimeVaryingRate) registry.get(metricName);
+
         value.pushMetric(metricsRecord);
       }
     }
@@ -103,4 +113,4 @@ public class HBaseRpcMetrics implements 
     if (rpcStatistics != null)
       rpcStatistics.shutdown();
   }
-}
\ No newline at end of file
+}

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java?rev=1378320&r1=1378319&r2=1378320&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java
Tue Aug 28 20:46:03 2012
@@ -19,7 +19,6 @@ package org.apache.hadoop.hbase.metrics;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.metrics.MetricsRecord;
 import org.apache.hadoop.metrics.util.MetricsRegistry;
 import org.apache.hadoop.metrics.util.MetricsTimeVaryingRate;
@@ -46,7 +45,7 @@ public class PersistentMetricsTimeVaryin
   public PersistentMetricsTimeVaryingRate(final String nam,
       final MetricsRegistry registry,
       final String description) {
-    super(nam, registry, description, HConstants.RESET_MINMAX);
+    super(nam, registry, description);
   }
 
   /**

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerDynamicMetrics.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerDynamicMetrics.java?rev=1378320&r1=1378319&r2=1378320&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerDynamicMetrics.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerDynamicMetrics.java
Tue Aug 28 20:46:03 2012
@@ -27,7 +27,6 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.hadoop.metrics.MetricsContext;
@@ -112,8 +111,7 @@ public class RegionServerDynamicMetrics 
       int numOps) {
     MetricsTimeVaryingRate m = (MetricsTimeVaryingRate)registry.get(name);
     if (m == null) {
-      m = new MetricsTimeVaryingRate(name, this.registry, MetricsBase.NO_DESCRIPTION, 
-          HConstants.RESET_MINMAX);
+      m = new MetricsTimeVaryingRate(name, this.registry);
       try {
         if (updateMbeanInfoIfMetricsListChanged != null) {
           updateMbeanInfoIfMetricsListChanged.invoke(this.rsDynamicStatistics,

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java?rev=1378320&r1=1378319&r2=1378320&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
Tue Aug 28 20:46:03 2012
@@ -43,6 +43,7 @@ import org.apache.hadoop.metrics.util.Me
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryUsage;
+import java.util.ArrayList;
 import java.util.List;
 
 /**



Mime
View raw message