jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r1536576 - in /jackrabbit/oak/trunk/oak-run: ./ src/main/java/org/apache/jackrabbit/oak/benchmark/
Date Tue, 29 Oct 2013 00:59:57 GMT
Author: tripod
Date: Tue Oct 29 00:59:57 2013
New Revision: 1536576

URL: http://svn.apache.org/r1536576
Log:
OAK-641: Improved benchmark tooling

- added concurrency levels
- remove bgThreads settings

Modified:
    jackrabbit/oak/trunk/oak-run/README.md
    jackrabbit/oak/trunk/oak-run/run_concurrent.sh
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/Benchmark.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest2.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadDeepTreeTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadSinglePolicyTreeTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ManyUserReadTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ReadDeepTreeTest.java

Modified: jackrabbit/oak/trunk/oak-run/README.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/README.md?rev=1536576&r1=1536575&r2=1536576&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/README.md (original)
+++ jackrabbit/oak/trunk/oak-run/README.md Tue Oct 29 00:59:57 2013
@@ -64,9 +64,9 @@ The following benchmark options (with de
     --wikipedia <file>     - Wikipedia dump
     --runAsAdmin false     - Run test as admin session
     --itemsToRead 1000     - Number of items to read
-    --bgReaders 20         - Number of background readers
     --report false         - Whether to output intermediate results
     --csvFile <file>       - Optional csv file to report the benchmark results
+    --concurrency <levels> - Comma separated list of concurrency levels
 
 These options are passed to the test cases and repository fixtures
 that need them. For example the Wikipedia dump option is needed by the
@@ -76,6 +76,8 @@ controls the bundle cache size in Jackra
 cache size in MongoMK and the default H2 MK, and the segment cache
 size in SegmentMK.
 
+The `--concurrency` levels can be specified as comma separated list of values, eg: `--concurrency
1,4,8`, which will execute the same test with the number of respective threads. Note that
the `beforeSuite()` and `afterSuite()` are executed before and after the concurrency loop.
eg. in the example above, the execution order is: `beforeSuite()`, 1x `runTest()`, 4x `runTest()`,
8x `runTest()`, `afterSuite()`. Tests that create their own background threads, should be
executed with `--concurrency 1` which is the default.
+
 You can use extra JVM options like `-Xmx` settings to better control the
 benchmark environment. It's also possible to attach the JVM to a
 profiler to better understand benchmark results. For example, I'm
@@ -124,7 +126,7 @@ reported:
 
 | Column      | Description                                           |
 |-------------|-------------------------------------------------------|
-| C           | concurrency level (only some tests)                   |
+| C           | concurrency level                                     |
 | min         | minimum time (in ms) taken by a test run              |
 | 10%         | time (in ms) in which the fastest 10% of test runs    |
 | 50%         | time (in ms) taken by the median test run             |

Modified: jackrabbit/oak/trunk/oak-run/run_concurrent.sh
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/run_concurrent.sh?rev=1536576&r1=1536575&r2=1536576&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/run_concurrent.sh (original)
+++ jackrabbit/oak/trunk/oak-run/run_concurrent.sh Tue Oct 29 00:59:57 2013
@@ -16,12 +16,12 @@
 # limitations under the License.
 #
 USERS="false true"
-RUNTIME=20
+RUNTIME=5
 #BENCH=ConcurrentReadAccessControlledTreeTest
 BENCH=ManyUserReadTest
 RANDOM_USER="true"
-FIXS="Oak-Tar" # Jackrabbit"
-THREADS="0 1 2 4 8 12 16 20"
+FIXS="Oak-Tar Jackrabbit"
+THREADS="1,2,4,8,10,15,20,50"
 PROFILE=false
 
 LOG=$BENCH"_$(date +'%Y%m%d_%H%M%S').csv"
@@ -35,12 +35,13 @@ echo "Profiling: $PROFILE" >> $LOG
 echo "--------------------------------------" >> $LOG
 for user in $USERS
     do
-    echo "Executing benchmarks as admin: $user" | tee -a $LOG
-    echo "-----------------------------------------------------------" | tee -a $LOG
-    for i in $THREADS
-        do
+    # we start new VMs for each fixture to minmize memory impacts between them
+    for fix in $FIXS
+	do
+        echo "Executing benchmarks as admin: $user on $fix" | tee -a $LOG
+	echo "-----------------------------------------------------------" | tee -a $LOG
         rm -rf target/Jackrabbit-* target/Oak-Tar-*
-        cmd="java -Xmx2048m -Dprofile=$PROFILE -Druntime=$RUNTIME -jar target/oak-run-*-SNAPSHOT.jar
benchmark --csvFile $LOG --bgReaders $i --runAsAdmin $user --report false --randomUser $RANDOM_USER
$BENCH $FIXS"
+        cmd="java -Xmx2048m -Dprofile=$PROFILE -Druntime=$RUNTIME -jar target/oak-run-*-SNAPSHOT.jar
benchmark --csvFile $LOG --concurrency $THREADS --runAsAdmin $user --report false --randomUser
$RANDOM_USER $BENCH $fix"
         echo $cmd
         $cmd 
     done

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=1536576&r1=1536575&r2=1536576&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 29 00:59:57 2013
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.oak.benchmark;
 
 import java.io.PrintStream;
+import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Random;
@@ -31,6 +32,7 @@ import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
 
 import org.apache.commons.math.stat.descriptive.DescriptiveStatistics;
+import org.apache.commons.math.stat.descriptive.SynchronizedDescriptiveStatistics;
 import org.apache.jackrabbit.oak.benchmark.util.Profiler;
 import org.apache.jackrabbit.oak.fixture.RepositoryFixture;
 
@@ -74,10 +76,8 @@ abstract class AbstractTest extends Benc
     private List<Thread> threads;
 
     private volatile boolean running;
-    
-    private Profiler profiler;
 
-    private int concurrency;
+    private Profiler profiler;
 
     private PrintStream out;
 
@@ -118,6 +118,11 @@ abstract class AbstractTest extends Benc
 
     @Override
     public void run(Iterable<RepositoryFixture> fixtures) {
+        run(fixtures, null);
+    }
+
+    @Override
+    public void run(Iterable<RepositoryFixture> fixtures, List<Integer> concurrencyLevels)
{
         System.out.format(
                 "# %-26.26s       C     min     10%%     50%%     90%%     max       N%n",
                 toString());
@@ -130,32 +135,7 @@ abstract class AbstractTest extends Benc
             try {
                 Repository[] cluster = fixture.setUpCluster(1);
                 try {
-                    // Run the test
-                    DescriptiveStatistics statistics = runTest(cluster[0]);
-                    if (statistics.getN() > 0) {
-                        System.out.format(
-                                "%-28.28s  %6d  %6.0f  %6.0f  %6.0f  %6.0f  %6.0f  %6d%n",
-                                fixture.toString(),
-                                concurrency,
-                                statistics.getMin(),
-                                statistics.getPercentile(10.0),
-                                statistics.getPercentile(50.0),
-                                statistics.getPercentile(90.0),
-                                statistics.getMax(),
-                                statistics.getN());
-                        if (out != null) {
-                            out.format(
-                                    "%-28.28s, %6d, %6.0f, %6.0f, %6.0f, %6.0f, %6.0f, %6d%n",
-                                    fixture.toString(),
-                                    concurrency,
-                                    statistics.getMin(),
-                                    statistics.getPercentile(10.0),
-                                    statistics.getPercentile(50.0),
-                                    statistics.getPercentile(90.0),
-                                    statistics.getMax(),
-                                    statistics.getN());
-                        }
-                    }
+                    runTest(fixture, cluster[0], concurrencyLevels);
                 } finally {
                     fixture.tearDownCluster();
                 }
@@ -165,8 +145,8 @@ abstract class AbstractTest extends Benc
         }
     }
 
-    private DescriptiveStatistics runTest(Repository repository) throws Exception {
-        DescriptiveStatistics statistics = new DescriptiveStatistics();
+
+    private void runTest(RepositoryFixture fixture, Repository repository, List<Integer>
concurrencyLevels) throws Exception {
 
         setUp(repository, CREDENTIALS);
         try {
@@ -177,15 +157,106 @@ abstract class AbstractTest extends Benc
                 execute();
             }
 
+            if (concurrencyLevels == null || concurrencyLevels.isEmpty()) {
+                concurrencyLevels = Arrays.asList(1);
+            }
+
+            for (Integer concurrency: concurrencyLevels) {
+                // Run the test
+                DescriptiveStatistics statistics = runTest(concurrency);
+                if (statistics.getN() > 0) {
+                    System.out.format(
+                            "%-28.28s  %6d  %6.0f  %6.0f  %6.0f  %6.0f  %6.0f  %6d%n",
+                            fixture.toString(),
+                            concurrency,
+                            statistics.getMin(),
+                            statistics.getPercentile(10.0),
+                            statistics.getPercentile(50.0),
+                            statistics.getPercentile(90.0),
+                            statistics.getMax(),
+                            statistics.getN());
+                    if (out != null) {
+                        out.format(
+                                "%-28.28s, %6d, %6.0f, %6.0f, %6.0f, %6.0f, %6.0f, %6d%n",
+                                fixture.toString(),
+                                concurrency,
+                                statistics.getMin(),
+                                statistics.getPercentile(10.0),
+                                statistics.getPercentile(50.0),
+                                statistics.getPercentile(90.0),
+                                statistics.getMax(),
+                                statistics.getN());
+                    }
+                }
+
+            }
+        } finally {
+            tearDown();
+        }
+    }
+
+    private class Executor extends Thread {
+
+        private final SynchronizedDescriptiveStatistics statistics;
+
+        private boolean running = true;
+
+        private Executor(String name, SynchronizedDescriptiveStatistics statistics) {
+            super(name);
+            this.statistics = statistics;
+        }
+
+        @Override
+        public void run() {
+            try {
+                while (running) {
+                    statistics.addValue(execute());
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+        }
+    }
+
+
+    private DescriptiveStatistics runTest(int concurrencyLevel) throws Exception {
+        final SynchronizedDescriptiveStatistics statistics = new SynchronizedDescriptiveStatistics();
+        if (concurrencyLevel == 1) {
             // Run test iterations, and capture the execution times
             long runtimeEnd = System.currentTimeMillis() + RUNTIME;
             while (System.currentTimeMillis() < runtimeEnd) {
                 statistics.addValue(execute());
             }
-        } finally {
-            tearDown();
-        }
 
+        } else {
+            List<Executor> threads = new LinkedList<Executor>();
+            for (int n=0; n<concurrencyLevel; n++) {
+                threads.add(new Executor("Background job " + n, statistics));
+            }
+
+            // start threads
+            for (Thread t: threads) {
+                t.start();
+            }
+            System.out.printf("Started %d threads%n", threads.size());
+
+            // Run test iterations, and capture the execution times
+            long runtimeEnd = System.currentTimeMillis() + RUNTIME;
+            while (System.currentTimeMillis() < runtimeEnd) {
+                Thread.sleep(runtimeEnd - System.currentTimeMillis());
+            }
+
+            // stop threads
+            for (Executor e: threads) {
+                e.running = false;
+            }
+
+            // wait for threads
+            for (Executor e: threads) {
+                e.join();
+            }
+        }
         return statistics;
     }
 
@@ -217,7 +288,7 @@ abstract class AbstractTest extends Benc
         for (Thread thread : threads) {
             thread.join();
         }
-        
+
         if (profiler != null) {
             System.out.println(profiler.stopCollecting().getTop(5));
             profiler = null;
@@ -231,7 +302,6 @@ abstract class AbstractTest extends Benc
             }
         }
 
-        concurrency = this.threads.size();
         this.threads = null;
         this.sessions = null;
         this.credentials = null;

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/Benchmark.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/Benchmark.java?rev=1536576&r1=1536575&r2=1536576&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/Benchmark.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/Benchmark.java
Tue Oct 29 00:59:57 2013
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.oak.benchmark;
 
+import java.util.List;
+
 import org.apache.jackrabbit.oak.fixture.RepositoryFixture;
 
 public abstract class Benchmark {
@@ -28,6 +30,11 @@ public abstract class Benchmark {
      */
     public abstract void run(Iterable<RepositoryFixture> fixtures);
 
+    public void run(Iterable<RepositoryFixture> fixtures, List<Integer> concurrencyLevels)
{
+        run(fixtures);
+    }
+
+
     public String toString() {
         String name = getClass().getName();
         return name.substring(name.lastIndexOf('.') + 1);

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java?rev=1536576&r1=1536575&r2=1536576&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java
Tue Oct 29 00:59:57 2013
@@ -62,8 +62,8 @@ public class BenchmarkRunner {
                 .withRequiredArg().ofType(Boolean.class).defaultsTo(Boolean.FALSE);
         OptionSpec<Integer> itemsToRead = parser.accepts("itemsToRead", "Number of
items to read")
                 .withRequiredArg().ofType(Integer.class).defaultsTo(1000);
-        OptionSpec<Integer> bgReaders = parser.accepts("bgReaders", "Number of background
readers")
-                .withRequiredArg().ofType(Integer.class).defaultsTo(20);
+        OptionSpec<Integer> concurrency = parser.accepts("concurrency", "Number of
test threads.")
+                .withRequiredArg().ofType(Integer.class).withValuesSeparatedBy(',');
         OptionSpec<Boolean> report = parser.accepts("report", "Whether to output intermediate
results")
                 .withOptionalArg().ofType(Boolean.class)
                 .defaultsTo(Boolean.FALSE);
@@ -127,27 +127,22 @@ public class BenchmarkRunner {
             new ConcurrentReadDeepTreeTest(
                     runAsAdmin.value(options),
                     itemsToRead.value(options),
-                    bgReaders.value(options),
                     report.value(options)),
             new ConcurrentReadSinglePolicyTreeTest(
                     runAsAdmin.value(options),
                     itemsToRead.value(options),
-                    bgReaders.value(options),
                     report.value(options)),
             new ConcurrentReadAccessControlledTreeTest(
                     runAsAdmin.value(options),
                     itemsToRead.value(options),
-                    bgReaders.value(options),
                     report.value(options)),
             new ConcurrentReadAccessControlledTreeTest2(
                     runAsAdmin.value(options),
                     itemsToRead.value(options),
-                    bgReaders.value(options),
                     report.value(options)),
             new ManyUserReadTest(
                     runAsAdmin.value(options),
                     itemsToRead.value(options),
-                    bgReaders.value(options),
                     report.value(options),
                     randomUser.value(options)),
             ReadManyTest.linear("LinearReadEmpty", 1, ReadManyTest.EMPTY),
@@ -184,7 +179,7 @@ public class BenchmarkRunner {
                 if (benchmark instanceof CSVResultGenerator) {
                     ((CSVResultGenerator) benchmark).setPrintStream(out);
                 }
-                benchmark.run(fixtures);
+                benchmark.run(fixtures, options.valuesOf(concurrency));
             }
             if (out != null) {
                 out.close();

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest.java?rev=1536576&r1=1536575&r2=1536576&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest.java
Tue Oct 29 00:59:57 2013
@@ -36,8 +36,8 @@ public class ConcurrentReadAccessControl
     int counter = 0;
 
     public ConcurrentReadAccessControlledTreeTest(
-            boolean runAsAdmin, int itemsToRead, int bgReaders, boolean doReport) {
-        super(runAsAdmin, itemsToRead, bgReaders, doReport);
+            boolean runAsAdmin, int itemsToRead, boolean doReport) {
+        super(runAsAdmin, itemsToRead, doReport);
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest2.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest2.java?rev=1536576&r1=1536575&r2=1536576&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest2.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadAccessControlledTreeTest2.java
Tue Oct 29 00:59:57 2013
@@ -40,10 +40,10 @@ import org.apache.jackrabbit.util.Text;
 public class ConcurrentReadAccessControlledTreeTest2 extends ConcurrentReadDeepTreeTest {
 
     int counter = 0;
-    final List<Principal> principals = new ArrayList();
+    final List<Principal> principals = new ArrayList<Principal>();
 
-    public ConcurrentReadAccessControlledTreeTest2(boolean runAsAdmin, int itemsToRead, int
bgReaders, boolean doReport) {
-        super(runAsAdmin, itemsToRead, bgReaders, doReport);
+    public ConcurrentReadAccessControlledTreeTest2(boolean runAsAdmin, int itemsToRead, boolean
doReport) {
+        super(runAsAdmin, itemsToRead, doReport);
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadDeepTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadDeepTreeTest.java?rev=1536576&r1=1536575&r2=1536576&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadDeepTreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadDeepTreeTest.java
Tue Oct 29 00:59:57 2013
@@ -21,8 +21,8 @@ package org.apache.jackrabbit.oak.benchm
  */
 public class ConcurrentReadDeepTreeTest extends ReadDeepTreeTest {
 
-    public ConcurrentReadDeepTreeTest(boolean runAsAdmin, int itemsToRead, int bgReaders,
boolean doReport) {
-        super(runAsAdmin, itemsToRead, bgReaders, doReport);
+    public ConcurrentReadDeepTreeTest(boolean runAsAdmin, int itemsToRead, boolean doReport)
{
+        super(runAsAdmin, itemsToRead, doReport);
     }
 
 }

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadSinglePolicyTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadSinglePolicyTreeTest.java?rev=1536576&r1=1536575&r2=1536576&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadSinglePolicyTreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadSinglePolicyTreeTest.java
Tue Oct 29 00:59:57 2013
@@ -33,8 +33,8 @@ import org.apache.jackrabbit.core.securi
 public class ConcurrentReadSinglePolicyTreeTest extends ConcurrentReadDeepTreeTest {
 
     public ConcurrentReadSinglePolicyTreeTest(
-            boolean runAsAdmin, int itemsToRead, int bgReaders, boolean doReport) {
-        super(runAsAdmin, itemsToRead, bgReaders, doReport);
+            boolean runAsAdmin, int itemsToRead, boolean doReport) {
+        super(runAsAdmin, itemsToRead, doReport);
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ManyUserReadTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ManyUserReadTest.java?rev=1536576&r1=1536575&r2=1536576&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ManyUserReadTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ManyUserReadTest.java
Tue Oct 29 00:59:57 2013
@@ -37,8 +37,8 @@ public class ManyUserReadTest extends Re
     private final int numberOfMembers = 10;
     private final boolean randomUser;
 
-    protected ManyUserReadTest(boolean runAsAdmin, int itemsToRead, int bgReaders, boolean
doReport, boolean randomUser) {
-        super(runAsAdmin, itemsToRead, bgReaders, doReport, !randomUser);
+    protected ManyUserReadTest(boolean runAsAdmin, int itemsToRead, boolean doReport, boolean
randomUser) {
+        super(runAsAdmin, itemsToRead, doReport, !randomUser);
         this.randomUser = randomUser;
     }
 

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ReadDeepTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ReadDeepTreeTest.java?rev=1536576&r1=1536575&r2=1536576&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ReadDeepTreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ReadDeepTreeTest.java
Tue Oct 29 00:59:57 2013
@@ -36,7 +36,6 @@ public class ReadDeepTreeTest extends Ab
 
     protected final boolean runAsAdmin;
     protected final int itemsToRead;
-    protected final int bgReaders;
     protected final boolean doReport;
 
     protected final boolean singleSession;
@@ -48,48 +47,27 @@ public class ReadDeepTreeTest extends Ab
 
     protected List<String> allPaths = new ArrayList<String>();
 
-    protected ReadDeepTreeTest(boolean runAsAdmin, int itemsToRead, int bgReaders, boolean
doReport) {
-        this(runAsAdmin, itemsToRead, bgReaders, doReport, true);
+    protected ReadDeepTreeTest(boolean runAsAdmin, int itemsToRead, boolean doReport) {
+        this(runAsAdmin, itemsToRead, doReport, true);
     }
 
-    public ReadDeepTreeTest(boolean runAsAdmin, int itemsToRead, int bgReaders, boolean doReport,
boolean singleSession) {
+    public ReadDeepTreeTest(boolean runAsAdmin, int itemsToRead, boolean doReport, boolean
singleSession) {
         this.runAsAdmin = runAsAdmin;
         this.itemsToRead = itemsToRead;
-        this.bgReaders = bgReaders;
         this.doReport = doReport;
         this.singleSession = singleSession;
     }
 
-    public ReadDeepTreeTest(boolean runAsAdmin, int itemsToRead, boolean doReport) {
-        this(runAsAdmin, itemsToRead, 0, doReport);
-    }
-
     @Override
     protected void beforeSuite() throws Exception {
         adminSession = loginWriter();
-
         createDeepTree();
-
-        for (int i = 0; i < bgReaders; i++) {
-            final Session session = singleSession ? getTestSession() : null;
-            addBackgroundJob(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        randomRead(session, allPaths, itemsToRead);
-                    } catch (RepositoryException e) {
-                        throw new RuntimeException(e);
-                    }
-                }
-            });
-        }
-        System.out.println("Threads started: " + bgReaders);
-
         testSession = singleSession ? getTestSession() : null;
     }
 
     protected void createDeepTree() throws Exception {
         Node rn = adminSession.getRootNode();
+        allPaths.clear();
 
         String testNodeName = getClass().getSimpleName() + TEST_ID;
         long start = System.currentTimeMillis();



Mime
View raw message