You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by nd...@apache.org on 2014/02/19 01:03:58 UTC

svn commit: r1569568 - /hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java

Author: ndimiduk
Date: Wed Feb 19 00:03:58 2014
New Revision: 1569568

URL: http://svn.apache.org/r1569568
Log:
HBASE-10511 Add latency percentiles on PerformanceEvaluation (Nicolas Liochon)

Modified:
    hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java

Modified: hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java?rev=1569568&r1=1569567&r2=1569568&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java (original)
+++ hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java Wed Feb 19 00:03:58 2014
@@ -39,6 +39,7 @@ import java.lang.reflect.Constructor;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.math.stat.descriptive.DescriptiveStatistics;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FileStatus;
@@ -1069,7 +1070,7 @@ public class PerformanceEvaluation exten
   static class RandomReadTest extends Test {
     private final int everyN;
     private final boolean reportLatency;
-    private final float[] times;
+    private final double[] times;
     int idx = 0;
 
     RandomReadTest(Configuration conf, TestOptions options, Status status) {
@@ -1078,7 +1079,7 @@ public class PerformanceEvaluation exten
       LOG.info("Sampling 1 every " + everyN + " out of " + perClientRunRows + " total rows.");
       this.reportLatency = options.isReportLatency();
       if (this.reportLatency) {
-        times = new float[(int) Math.ceil(this.perClientRunRows * this.sampleRate)];
+        times = new double[(int) Math.ceil(this.perClientRunRows * this.sampleRate)];
       } else {
         times = null;
       }
@@ -1107,7 +1108,20 @@ public class PerformanceEvaluation exten
     protected void testTakedown() throws IOException {
       super.testTakedown();
       if (this.reportLatency) {
-        LOG.info("randomRead latency log (ms): " + Arrays.toString(times));
+        DescriptiveStatistics ds;
+        Arrays.sort(times);
+        ds = new DescriptiveStatistics(times);
+        LOG.info("randomRead latency log (ms), on " + times.length + " measures");
+        LOG.info("99.9999% = " + ds.getPercentile(99.9999d));
+        LOG.info(" 99.999% = " + ds.getPercentile(99.999d));
+        LOG.info("  99.99% = " + ds.getPercentile(99.99d));
+        LOG.info("   99.9% = " + ds.getPercentile(99.9d));
+        LOG.info("     99% = " + ds.getPercentile(99d));
+        LOG.info("     95% = " + ds.getPercentile(95d));
+        LOG.info("     90% = " + ds.getPercentile(90d));
+        LOG.info("     80% = " + ds.getPercentile(80d));
+        LOG.info("Standard Deviation = " + ds.getStandardDeviation());
+        LOG.info("Mean = " + ds.getMean());
       }
     }
   }