You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2013/10/01 08:03:23 UTC

svn commit: r1527910 - in /jackrabbit/oak/trunk/oak-run: README.md src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java

Author: thomasm
Date: Tue Oct  1 06:03:23 2013
New Revision: 1527910

URL: http://svn.apache.org/r1527910
Log:
OAK-641: Improved benchmark tooling - remove the lower limit for number of iterations (it is currently a problem for the XmlImportTest with MongoMK), and change the warmup so it is seconds instead of iterations

Modified:
    jackrabbit/oak/trunk/oak-run/README.md
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java

Modified: jackrabbit/oak/trunk/oak-run/README.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/README.md?rev=1527910&r1=1527909&r2=1527910&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/README.md (original)
+++ jackrabbit/oak/trunk/oak-run/README.md Tue Oct  1 06:03:23 2013
@@ -45,7 +45,7 @@ the benchmarked codebase.
 
 Some system properties are also used to control the benchmarks. For example:
 
-    -Dwarmup=5         - number of warmup iterations
+    -Dwarmup=5         - warmup time (in seconds)
     -Druntime=60       - how long a single benchmark should run (in seconds)
 
 The test case names like `ReadPropertyTest`, `SmallFileReadTest` and
@@ -74,8 +74,8 @@ Once started, the benchmark runner will 
 against all the listed repository fixtures. After starting up the
 repository and preparing the test environment, the test case is first
 executed a few times to warm up caches before measurements are
-started. Then the test case is run repeatedly for one minute (or at
-least 10 times) and the number of milliseconds used by each execution
+started. Then the test case is run repeatedly for one minute 
+and the number of milliseconds used by each execution
 is recorded. Once done, the following statistics are computed and
 reported:
 

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java?rev=1527910&r1=1527909&r2=1527910&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java (original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java Tue Oct  1 06:03:23 2013
@@ -37,7 +37,7 @@ abstract class AbstractTest extends Benc
 
     private static final Credentials CREDENTIALS = new SimpleCredentials("admin", "admin".toCharArray());
 
-    private static final int WARMUP = Integer.getInteger("warmup", 5);
+    private static final long WARMUP = TimeUnit.SECONDS.toMillis(Long.getLong("warmup", 5));
 
     private static final long RUNTIME = TimeUnit.SECONDS.toMillis(Long.getLong("runtime", 60));
 
@@ -114,16 +114,16 @@ abstract class AbstractTest extends Benc
 
         setUp(repository, CREDENTIALS);
         try {
+            
             // Run a few iterations to warm up the system
-            for (int i = 0; i < WARMUP; i++) {
+            long warmupEnd = System.currentTimeMillis() + WARMUP;
+            while (System.currentTimeMillis() < warmupEnd) {
                 execute();
             }
 
             // Run test iterations, and capture the execution times
-            int iterations = 0;
             long runtimeEnd = System.currentTimeMillis() + RUNTIME;
-            while (iterations++ < 10
-                    || System.currentTimeMillis() < runtimeEnd) {
+            while (System.currentTimeMillis() < runtimeEnd) {
                 statistics.addValue(execute());
             }
         } finally {