hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-17716 Formalize Scan Metric names
Date Tue, 07 Mar 2017 15:44:30 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 628490b29 -> d46e9613b


HBASE-17716 Formalize Scan Metric names

Signed-off-by: Michael Stack <stack@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d46e9613
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d46e9613
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d46e9613

Branch: refs/heads/branch-1.2
Commit: d46e9613b4efd88a82efb437398389a785c0e12b
Parents: 628490b
Author: Karan Mehta <k.mehta@kmehta-ltm1.internal.salesforce.com>
Authored: Mon Mar 6 18:18:09 2017 -0800
Committer: Michael Stack <stack@apache.org>
Committed: Tue Mar 7 07:44:23 2017 -0800

----------------------------------------------------------------------
 .../hbase/client/metrics/ScanMetrics.java       | 28 +++++++++++++-------
 .../client/metrics/ServerSideScanMetrics.java   |  8 +++---
 ...TestServerSideScanMetricsFromClientSide.java | 14 +++++-----
 3 files changed, 30 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d46e9613/hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetrics.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetrics.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetrics.java
index ec2c937..73b3892 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetrics.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetrics.java
@@ -44,50 +44,60 @@ public class ScanMetrics extends ServerSideScanMetrics {
   // ScannerCallable. They are atomic longs so that atomic getAndSet can be used to reset
the
   // values after progress is passed to hadoop's counters.
 
+  public static final String RPC_CALLS_METRIC_NAME = "RPC_CALLS";
+  public static final String REMOTE_RPC_CALLS_METRIC_NAME = "REMOTE_RPC_CALLS";
+  public static final String MILLIS_BETWEEN_NEXTS_METRIC_NAME = "MILLIS_BETWEEN_NEXTS";
+  public static final String NOT_SERVING_REGION_EXCEPTION_METRIC_NAME = "NOT_SERVING_REGION_EXCEPTION";
+  public static final String BYTES_IN_RESULTS_METRIC_NAME = "BYTES_IN_RESULTS";
+  public static final String BYTES_IN_REMOTE_RESULTS_METRIC_NAME = "BYTES_IN_REMOTE_RESULTS";
+  public static final String REGIONS_SCANNED_METRIC_NAME = "REGIONS_SCANNED";
+  public static final String RPC_RETRIES_METRIC_NAME = "RPC_RETRIES";
+  public static final String REMOTE_RPC_RETRIES_METRIC_NAME = "REMOTE_RPC_RETRIES";
+ 
   /**
    * number of RPC calls
    */
-  public final AtomicLong countOfRPCcalls = createCounter("RPC_CALLS");
+  public final AtomicLong countOfRPCcalls = createCounter(RPC_CALLS_METRIC_NAME);
 
   /**
    * number of remote RPC calls
    */
-  public final AtomicLong countOfRemoteRPCcalls = createCounter("REMOTE_RPC_CALLS");
+  public final AtomicLong countOfRemoteRPCcalls = createCounter(REMOTE_RPC_CALLS_METRIC_NAME);
 
   /**
    * sum of milliseconds between sequential next calls
    */
-  public final AtomicLong sumOfMillisSecBetweenNexts = createCounter("MILLIS_BETWEEN_NEXTS");
+  public final AtomicLong sumOfMillisSecBetweenNexts = createCounter(MILLIS_BETWEEN_NEXTS_METRIC_NAME);
 
   /**
    * number of NotServingRegionException caught
    */
-  public final AtomicLong countOfNSRE = createCounter("NOT_SERVING_REGION_EXCEPTION");
+  public final AtomicLong countOfNSRE = createCounter(NOT_SERVING_REGION_EXCEPTION_METRIC_NAME);
 
   /**
    * number of bytes in Result objects from region servers
    */
-  public final AtomicLong countOfBytesInResults = createCounter("BYTES_IN_RESULTS");
+  public final AtomicLong countOfBytesInResults = createCounter(BYTES_IN_RESULTS_METRIC_NAME);
 
   /**
    * number of bytes in Result objects from remote region servers
    */
-  public final AtomicLong countOfBytesInRemoteResults = createCounter("BYTES_IN_REMOTE_RESULTS");
+  public final AtomicLong countOfBytesInRemoteResults = createCounter(BYTES_IN_REMOTE_RESULTS_METRIC_NAME);
 
   /**
    * number of regions
    */
-  public final AtomicLong countOfRegions = createCounter("REGIONS_SCANNED");
+  public final AtomicLong countOfRegions = createCounter(REGIONS_SCANNED_METRIC_NAME);
 
   /**
    * number of RPC retries
    */
-  public final AtomicLong countOfRPCRetries = createCounter("RPC_RETRIES");
+  public final AtomicLong countOfRPCRetries = createCounter(RPC_RETRIES_METRIC_NAME);
 
   /**
    * number of remote RPC retries
    */
-  public final AtomicLong countOfRemoteRPCRetries = createCounter("REMOTE_RPC_RETRIES");
+  public final AtomicLong countOfRemoteRPCRetries = createCounter(REMOTE_RPC_RETRIES_METRIC_NAME);
 
   /**
    * constructor

http://git-wip-us.apache.org/repos/asf/hbase/blob/d46e9613/hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ServerSideScanMetrics.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ServerSideScanMetrics.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ServerSideScanMetrics.java
index 46b67d4..4b3e0ce 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ServerSideScanMetrics.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ServerSideScanMetrics.java
@@ -48,19 +48,19 @@ public class ServerSideScanMetrics {
     return c;
   }
 
-  public static final String COUNT_OF_ROWS_SCANNED_KEY = "ROWS_SCANNED";
-  public static final String COUNT_OF_ROWS_FILTERED_KEY = "ROWS_FILTERED";
+  public static final String COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME = "ROWS_SCANNED";
+  public static final String COUNT_OF_ROWS_FILTERED_KEY_METRIC_NAME = "ROWS_FILTERED";
 
   /**
    * number of rows filtered during scan RPC
    */
-  public final AtomicLong countOfRowsFiltered = createCounter(COUNT_OF_ROWS_FILTERED_KEY);
+  public final AtomicLong countOfRowsFiltered = createCounter(COUNT_OF_ROWS_FILTERED_KEY_METRIC_NAME);
 
   /**
    * number of rows scanned during scan RPC. Not every row scanned will be returned to the
client
    * since rows may be filtered.
    */
-  public final AtomicLong countOfRowsScanned = createCounter(COUNT_OF_ROWS_SCANNED_KEY);
+  public final AtomicLong countOfRowsScanned = createCounter(COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME);
 
   /**
    * @param counterName

http://git-wip-us.apache.org/repos/asf/hbase/blob/d46e9613/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerSideScanMetricsFromClientSide.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerSideScanMetricsFromClientSide.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerSideScanMetricsFromClientSide.java
index 6f91515..da294b1 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerSideScanMetricsFromClientSide.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerSideScanMetricsFromClientSide.java
@@ -178,41 +178,41 @@ public class TestServerSideScanMetricsFromClientSide {
   public void testRowsSeenMetric(Scan baseScan) throws Exception {
     Scan scan;
     scan = new Scan(baseScan);
-    testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY, NUM_ROWS);
+    testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME, NUM_ROWS);
 
     for (int i = 0; i < ROWS.length - 1; i++) {
       scan = new Scan(baseScan);
       scan.setStartRow(ROWS[0]);
       scan.setStopRow(ROWS[i + 1]);
-      testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY, i + 1);
+      testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME, i + 1);
     }
 
     for (int i = ROWS.length - 1; i > 0; i--) {
       scan = new Scan(baseScan);
       scan.setStartRow(ROWS[i - 1]);
       scan.setStopRow(ROWS[ROWS.length - 1]);
-      testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY, ROWS.length - i);
+      testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME, ROWS.length
- i);
     }
 
     // The filter should filter out all rows, but we still expect to see every row.
     Filter filter = new RowFilter(CompareOp.EQUAL, new BinaryComparator("xyz".getBytes()));
     scan = new Scan(baseScan);
     scan.setFilter(filter);
-    testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY, ROWS.length);
+    testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME, ROWS.length);
 
     // Filter should pass on all rows
     SingleColumnValueFilter singleColumnValueFilter =
         new SingleColumnValueFilter(FAMILIES[0], QUALIFIERS[0], CompareOp.EQUAL, VALUE);
     scan = new Scan(baseScan);
     scan.setFilter(singleColumnValueFilter);
-    testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY, ROWS.length);
+    testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME, ROWS.length);
 
     // Filter should filter out all rows
     singleColumnValueFilter =
         new SingleColumnValueFilter(FAMILIES[0], QUALIFIERS[0], CompareOp.NOT_EQUAL, VALUE);
     scan = new Scan(baseScan);
     scan.setFilter(singleColumnValueFilter);
-    testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY, ROWS.length);
+    testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME, ROWS.length);
   }
 
   @Test
@@ -295,7 +295,7 @@ public class TestServerSideScanMetricsFromClientSide {
       throws Exception {
     Scan scan = new Scan(baseScan);
     if (filter != null) scan.setFilter(filter);
-    testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_FILTERED_KEY, expectedNumFiltered);
+    testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_FILTERED_KEY_METRIC_NAME, expectedNumFiltered);
   }
 
   /**


Mime
View raw message