jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1504180 - in /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark: AbstractDeepTreeTest.java BenchmarkRunner.java ConcurrentReadAccessControlledTreeTest.java ConcurrentReadDeepTreeTest.java ReadDeepTreeTest.java
Date Wed, 17 Jul 2013 15:48:46 GMT
Author: angela
Date: Wed Jul 17 15:48:45 2013
New Revision: 1504180

URL: http://svn.apache.org/r1504180
Log:
OAK-908 : Performance measurement 

- make number of items to read and number of bg readers configurable

Modified:
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractDeepTreeTest.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/ConcurrentReadDeepTreeTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ReadDeepTreeTest.java

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractDeepTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractDeepTreeTest.java?rev=1504180&r1=1504179&r2=1504180&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractDeepTreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractDeepTreeTest.java
Wed Jul 17 15:48:45 2013
@@ -30,15 +30,19 @@ import javax.jcr.util.TraversingItemVisi
 
 public abstract class AbstractDeepTreeTest extends AbstractTest {
 
-    private final boolean runAsAdmin;
+    protected final boolean runAsAdmin;
+    protected final int itemsToRead;
+    protected final int bgReaders;
 
     protected Session adminSession;
     protected Node testRoot;
 
     protected List<String> allPaths;
 
-    public AbstractDeepTreeTest(boolean runAsAdmin) {
+    public AbstractDeepTreeTest(boolean runAsAdmin, int itemsToRead, int bgReaders) {
         this.runAsAdmin = runAsAdmin;
+        this.itemsToRead = itemsToRead;
+        this.bgReaders = bgReaders;
     }
 
     @Override

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=1504180&r1=1504179&r2=1504180&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
Wed Jul 17 15:48:45 2013
@@ -52,6 +52,11 @@ public class BenchmarkRunner {
                 .withRequiredArg().ofType(File.class);
         OptionSpec<Boolean> runAsAdmin = parser.accepts("runAsAdmin", "Run test using
admin session")
                 .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(1000);
+
 
         OptionSet options = parser.parse(args);
         int cacheSize = cache.value(options);
@@ -89,9 +94,9 @@ public class BenchmarkRunner {
             new ObservationTest(),
             new XmlImportTest(),
             new FlatTreeWithAceForSamePrincipalTest(),
-            new ReadDeepTreeTest(runAsAdmin.value(options)),
-            new ConcurrentReadAccessControlledTreeTest(runAsAdmin.value(options)),
-            new ConcurrentReadDeepTreeTest(runAsAdmin.value(options)),
+            new ReadDeepTreeTest(runAsAdmin.value(options), itemsToRead.value(options)),
+            new ConcurrentReadAccessControlledTreeTest(runAsAdmin.value(options), itemsToRead.value(options),
bgReaders.value(options)),
+            new ConcurrentReadDeepTreeTest(runAsAdmin.value(options), itemsToRead.value(options),
bgReaders.value(options)),
             ReadManyTest.linear("LinearReadEmpty", 1, ReadManyTest.EMPTY),
             ReadManyTest.linear("LinearReadFiles", 1, ReadManyTest.FILES),
             ReadManyTest.linear("LinearReadNodes", 1, ReadManyTest.NODES),

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=1504180&r1=1504179&r2=1504180&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
Wed Jul 17 15:48:45 2013
@@ -37,11 +37,8 @@ import org.apache.jackrabbit.util.Text;
  */
 public class ConcurrentReadAccessControlledTreeTest extends AbstractDeepTreeTest {
 
-    private int bgReaders = 20;
-    private int cnt = 10000;
-
-    public ConcurrentReadAccessControlledTreeTest(boolean runAsAdmin) {
-        super(runAsAdmin);
+    public ConcurrentReadAccessControlledTreeTest(boolean runAsAdmin, int itemsToRead, int
bgReaders) {
+        super(runAsAdmin, itemsToRead, bgReaders);
     }
 
     @Override
@@ -117,7 +114,7 @@ public class ConcurrentReadAccessControl
         }
         public void run() {
             try {
-                randomRead(testSession, allPaths, cnt, doReport);
+                randomRead(testSession, allPaths, itemsToRead, doReport);
             } catch (RepositoryException e) {
                 throw new RuntimeException(e);
             }

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=1504180&r1=1504179&r2=1504180&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
Wed Jul 17 15:48:45 2013
@@ -24,11 +24,8 @@ import javax.jcr.Session;
  */
 public class ConcurrentReadDeepTreeTest extends AbstractDeepTreeTest {
 
-    private int bgReaders = 50;
-    private int cnt = 10000;
-
-    public ConcurrentReadDeepTreeTest(boolean runAsAdmin) {
-        super(runAsAdmin);
+    public ConcurrentReadDeepTreeTest(boolean runAsAdmin, int itemsToRead, int bgReaders)
{
+        super(runAsAdmin, itemsToRead, bgReaders);
     }
 
     @Override
@@ -58,7 +55,7 @@ public class ConcurrentReadDeepTreeTest 
 
         public void run() {
             try {
-                randomRead(testSession, allPaths, cnt, true);
+                randomRead(testSession, allPaths, itemsToRead, true);
             } catch (RepositoryException e) {
                 throw new RuntimeException(e);
             }

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=1504180&r1=1504179&r2=1504180&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
Wed Jul 17 15:48:45 2013
@@ -21,10 +21,8 @@ package org.apache.jackrabbit.oak.benchm
  */
 public class ReadDeepTreeTest extends AbstractDeepTreeTest {
 
-    private int cnt = 1000;
-
-    public ReadDeepTreeTest(boolean runAsAdmin) {
-        super(runAsAdmin);
+    public ReadDeepTreeTest(boolean runAsAdmin, int itemsToRead) {
+        super(runAsAdmin, itemsToRead, 0);
     }
     @Override
     protected void beforeSuite() throws Exception {
@@ -33,6 +31,6 @@ public class ReadDeepTreeTest extends Ab
 
     @Override
     protected void runTest() throws Exception {
-        randomRead(getTestSession(), allPaths, cnt, true);
+        randomRead(getTestSession(), allPaths, itemsToRead, true);
     }
 }
\ No newline at end of file



Mime
View raw message