hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1370583 - in /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver: SplitRequest.java metrics/RegionServerMetrics.java
Date Tue, 07 Aug 2012 22:56:05 GMT
Author: stack
Date: Tue Aug  7 22:56:05 2012
New Revision: 1370583

URL: http://svn.apache.org/viewvc?rev=1370583&view=rev
Log:
HBASE-5819 Add metrics to keep track of region-splits in RS

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java?rev=1370583&r1=1370582&r2=1370583&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java
Tue Aug  7 22:56:05 2012
@@ -67,7 +67,7 @@ class SplitRequest implements Runnable {
       if (!st.prepare()) return;
       try {
         st.execute(this.server, this.server);
-        this.server.getMetrics().incrementSplitSuccessCount();
+        this.server.getMetrics().incrementSplitSuccessCount(System.currentTimeMillis() -
startTime);
       } catch (Exception e) {
         if (this.server.isStopping() || this.server.isStopped()) {
           LOG.info(

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java?rev=1370583&r1=1370582&r2=1370583&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
Tue Aug  7 22:56:05 2012
@@ -32,6 +32,7 @@ import org.apache.hadoop.hbase.metrics.E
 import org.apache.hadoop.hbase.metrics.HBaseInfo;
 import org.apache.hadoop.hbase.metrics.MetricsRate;
 import org.apache.hadoop.hbase.metrics.histogram.MetricsHistogram;
+import org.apache.hadoop.hbase.metrics.PersistentMetricsTimeVaryingRate;
 import com.yammer.metrics.stats.Snapshot;
 import org.apache.hadoop.hbase.regionserver.wal.HLog;
 import org.apache.hadoop.hbase.util.Pair;
@@ -287,11 +288,11 @@ public class RegionServerMetrics impleme
   public final MetricsTimeVaryingRate slowHLogAppendTime =
       new MetricsTimeVaryingRate("slowHLogAppendTime", registry);
   
-  public final MetricsTimeVaryingLong regionSplitSuccessCount =
-      new MetricsTimeVaryingLong("regionSplitSuccessCount", registry);
+  public final PersistentMetricsTimeVaryingRate regionSplitSuccessCount =
+      new PersistentMetricsTimeVaryingRate("regionSplitSuccessCount", registry);
   
-  public final MetricsTimeVaryingLong regionSplitFailureCount =
-      new MetricsTimeVaryingLong("regionSplitFailureCount", registry);
+  public final MetricsLongValue regionSplitFailureCount =
+      new MetricsLongValue("regionSplitFailureCount", registry);
 
   /**
    * Number of times checksum verification failed.
@@ -496,12 +497,12 @@ public class RegionServerMetrics impleme
     this.requests.inc(inc);
   }
   
-  public void incrementSplitSuccessCount() {
-    this.regionSplitSuccessCount.inc();
+  public void incrementSplitSuccessCount(long time) {
+    this.regionSplitSuccessCount.inc(time);
   }
   
   public void incrementSplitFailureCount() {
-    this.regionSplitFailureCount.inc();
+    this.regionSplitFailureCount.set(this.regionSplitFailureCount.get() + 1);
   }
 
   @Override



Mime
View raw message