You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by nk...@apache.org on 2014/08/04 11:41:50 UTC

git commit: HBASE-11585 PE: Allows warm-up

Repository: hbase
Updated Branches:
  refs/heads/master 543c64d2e -> 4d005b70a


HBASE-11585 PE: Allows warm-up


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

Branch: refs/heads/master
Commit: 4d005b70a0fda4be5a8ead84ff5f54fceb3c637a
Parents: 543c64d
Author: Nicolas Liochon <nk...@gmail.com>
Authored: Mon Aug 4 11:41:34 2014 +0200
Committer: Nicolas Liochon <nk...@gmail.com>
Committed: Mon Aug 4 11:41:34 2014 +0200

----------------------------------------------------------------------
 .../hadoop/hbase/PerformanceEvaluation.java     | 26 +++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/4d005b70/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index 1634b55..d31c843 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
@@ -567,6 +567,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
     int perClientRunRows = DEFAULT_ROWS_PER_GB;
     int numClientThreads = 1;
     int totalRows = DEFAULT_ROWS_PER_GB;
+    int measureAfter = 0;
     float sampleRate = 1.0f;
     double traceRate = 0.0;
     String tableName = TABLE_NAME;
@@ -631,6 +632,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
       this.valueSize = that.valueSize;
       this.period = that.period;
       this.randomSleep = that.randomSleep;
+      this.measureAfter = that.measureAfter;
     }
 
     public int getCycles() {
@@ -888,6 +890,14 @@ public class PerformanceEvaluation extends Configured implements Tool {
     public boolean isOneCon() {
       return oneCon;
     }
+
+    public int getMeasureAfter() {
+      return measureAfter;
+    }
+
+    public void setMeasureAfter(int measureAfter) {
+      this.measureAfter = measureAfter;
+    }
   }
 
   /*
@@ -1048,9 +1058,11 @@ public class PerformanceEvaluation extends Configured implements Tool {
           } finally {
             scope.close();
           }
-          latency.update((System.nanoTime() - startTime) / 1000);
-          if (status != null && i > 0 && (i % getReportingPeriod()) == 0) {
-            status.setStatus(generateStatus(opts.startRow, i, lastRow));
+          if ( (i - opts.startRow) > opts.measureAfter) {
+            latency.update((System.nanoTime() - startTime) / 1000);
+            if (status != null && i > 0 && (i % getReportingPeriod()) == 0) {
+              status.setStatus(generateStatus(opts.startRow, i, lastRow));
+            }
           }
         }
       }
@@ -1611,6 +1623,8 @@ public class PerformanceEvaluation extends Configured implements Tool {
         + " there by not returning any thing back to the client.  Helps to check the server side"
         + " performance.  Uses FilterAllFilter internally. ");
     System.err.println(" latency         Set to report operation latencies. Default: False");
+    System.err.println(" measureAfter    Start to measure the latency once 'measureAfter'" +
+        " rows have been treated. Default: 0");
     System.err.println(" bloomFilter      Bloom filter type, one of " + Arrays.toString(BloomType.values()));
     System.err.println(" valueSize       Pass value size to use: Default: 1024");
     System.err.println(" valueRandom     Set if we should vary value size between 0 and " +
@@ -1808,6 +1822,12 @@ public class PerformanceEvaluation extends Configured implements Tool {
         continue;
       }
 
+      final String measureAfter = "--measureAfter=";
+      if (cmd.startsWith(measureAfter)) {
+        opts.measureAfter = Integer.parseInt(cmd.substring(measureAfter.length()));
+        continue;
+      }
+
       final String bloomFilter = "--bloomFilter=";
       if (cmd.startsWith(bloomFilter)) {
         opts.bloomType = BloomType.valueOf(cmd.substring(bloomFilter.length()));