Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88DA2971E for ; Wed, 22 Feb 2012 06:51:26 +0000 (UTC) Received: (qmail 41434 invoked by uid 500); 22 Feb 2012 06:51:26 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 40989 invoked by uid 500); 22 Feb 2012 06:51:25 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 40756 invoked by uid 99); 22 Feb 2012 06:51:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2012 06:51:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2012 06:51:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 511EB2388865 for ; Wed, 22 Feb 2012 06:51:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1292139 - in /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver: SplitRequest.java metrics/RegionServerMetrics.java Date: Wed, 22 Feb 2012 06:51:03 -0000 To: commits@hbase.apache.org From: stack@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120222065103.511EB2388865@eris.apache.org> Author: stack Date: Wed Feb 22 06:51:02 2012 New Revision: 1292139 URL: http://svn.apache.org/viewvc?rev=1292139&view=rev Log: HBASE-5189 Add metrics to keep track of region-splits in RS Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java?rev=1292139&r1=1292138&r2=1292139&view=diff ============================================================================== --- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java (original) +++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java Wed Feb 22 06:51:02 2012 @@ -65,6 +65,7 @@ class SplitRequest implements Runnable { if (!st.prepare()) return; try { st.execute(this.server, this.server); + this.server.getMetrics().incrementSplitSuccessCount(); } catch (Exception e) { try { LOG.info("Running rollback/cleanup of failed split of " + @@ -72,6 +73,7 @@ class SplitRequest implements Runnable { if (st.rollback(this.server, this.server)) { LOG.info("Successful rollback of failed split of " + parent.getRegionNameAsString()); + this.server.getMetrics().incrementSplitFailureCount(); } else { this.server.abort("Abort; we got an error after point-of-no-return"); } @@ -92,6 +94,7 @@ class SplitRequest implements Runnable { } catch (IOException ex) { LOG.error("Split failed " + this, RemoteExceptionHandler .checkIOException(ex)); + this.server.getMetrics().incrementSplitFailureCount(); server.checkFileSystem(); } } Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java?rev=1292139&r1=1292138&r2=1292139&view=diff ============================================================================== --- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java (original) +++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java Wed Feb 22 06:51:02 2012 @@ -38,6 +38,7 @@ import org.apache.hadoop.metrics.util.Me import org.apache.hadoop.metrics.util.MetricsLongValue; import org.apache.hadoop.metrics.util.MetricsRegistry; import org.apache.hadoop.metrics.util.MetricsTimeVaryingRate; +import org.apache.hadoop.metrics.util.MetricsTimeVaryingLong; import org.apache.hadoop.util.StringUtils; import java.io.IOException; @@ -238,6 +239,12 @@ public class RegionServerMetrics impleme public final MetricsTimeVaryingRate slowHLogAppendTime = new MetricsTimeVaryingRate("slowHLogAppendTime", registry); + + public final MetricsTimeVaryingLong regionSplitSuccessCount = + new MetricsTimeVaryingLong("regionSplitSuccessCount", registry); + + public final MetricsTimeVaryingLong regionSplitFailureCount = + new MetricsTimeVaryingLong("regionSplitFailureCount", registry); public RegionServerMetrics() { MetricsContext context = MetricsUtil.getContext("hbase"); @@ -354,6 +361,8 @@ public class RegionServerMetrics impleme this.flushTime.pushMetric(this.metricsRecord); this.flushSize.pushMetric(this.metricsRecord); this.slowHLogAppendCount.pushMetric(this.metricsRecord); + this.regionSplitSuccessCount.pushMetric(this.metricsRecord); + this.regionSplitFailureCount.pushMetric(this.metricsRecord); } this.metricsRecord.update(); } @@ -411,6 +420,14 @@ public class RegionServerMetrics impleme public void incrementRequests(final int inc) { this.requests.inc(inc); } + + public void incrementSplitSuccessCount() { + this.regionSplitSuccessCount.inc(); + } + + public void incrementSplitFailureCount() { + this.regionSplitFailureCount.inc(); + } @Override public String toString() {