jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1525690 - 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 Mon, 23 Sep 2013 20:37:30 GMT
Author: jukka
Date: Mon Sep 23 20:37:29 2013
New Revision: 1525690

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

Reduce output by default

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=1525690&r1=1525689&r2=1525690&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
Mon Sep 23 20:37:29 2013
@@ -33,16 +33,19 @@ public abstract class AbstractDeepTreeTe
     protected final boolean runAsAdmin;
     protected final int itemsToRead;
     protected final int bgReaders;
+    protected final boolean doReport;
 
     protected Session adminSession;
     protected Node testRoot;
 
     protected List<String> allPaths;
 
-    public AbstractDeepTreeTest(boolean runAsAdmin, int itemsToRead, int bgReaders) {
+    public AbstractDeepTreeTest(
+            boolean runAsAdmin, int itemsToRead, int bgReaders, boolean doReport) {
         this.runAsAdmin = runAsAdmin;
         this.itemsToRead = itemsToRead;
         this.bgReaders = bgReaders;
+        this.doReport = doReport;
     }
 
     @Override
@@ -92,7 +95,7 @@ public abstract class AbstractDeepTreeTe
         }
     }
 
-    protected static void randomRead(Session testSession, List<String> allPaths, int
cnt, boolean doReport) throws RepositoryException {
+    protected void randomRead(Session testSession, List<String> allPaths, int cnt)
throws RepositoryException {
         int nodeCnt = 0;
         int propertyCnt = 0;
         int noAccess = 0;

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=1525690&r1=1525689&r2=1525690&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
Mon Sep 23 20:37:29 2013
@@ -57,7 +57,9 @@ public class BenchmarkRunner {
                 .withRequiredArg().ofType(Integer.class).defaultsTo(1000);
         OptionSpec<Integer> bgReaders = parser.accepts("bgReaders", "Number of background
readers")
                 .withRequiredArg().ofType(Integer.class).defaultsTo(20);
-
+        OptionSpec<Boolean> report = parser.accepts("report", "Whether to output intermediate
results")
+                .withOptionalArg().ofType(Boolean.class)
+                .defaultsTo(Boolean.FALSE);
 
         OptionSet options = parser.parse(args);
         int cacheSize = cache.value(options);
@@ -99,9 +101,20 @@ public class BenchmarkRunner {
             new ObservationTest(),
             new XmlImportTest(),
             new FlatTreeWithAceForSamePrincipalTest(),
-            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)),
+            new ReadDeepTreeTest(
+                    runAsAdmin.value(options),
+                    itemsToRead.value(options),
+                    report.value(options)),
+            new ConcurrentReadAccessControlledTreeTest(
+                    runAsAdmin.value(options),
+                    itemsToRead.value(options),
+                    bgReaders.value(options),
+                    report.value(options)),
+            new ConcurrentReadDeepTreeTest(
+                    runAsAdmin.value(options),
+                    itemsToRead.value(options),
+                    bgReaders.value(options),
+                    report.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=1525690&r1=1525689&r2=1525690&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
Mon Sep 23 20:37:29 2013
@@ -37,8 +37,9 @@ import org.apache.jackrabbit.util.Text;
  */
 public class ConcurrentReadAccessControlledTreeTest extends AbstractDeepTreeTest {
 
-    public ConcurrentReadAccessControlledTreeTest(boolean runAsAdmin, int itemsToRead, int
bgReaders) {
-        super(runAsAdmin, itemsToRead, bgReaders);
+    public ConcurrentReadAccessControlledTreeTest(
+            boolean runAsAdmin, int itemsToRead, int bgReaders, boolean doReport) {
+        super(runAsAdmin, itemsToRead, bgReaders, doReport);
     }
 
     @Override
@@ -91,14 +92,14 @@ public class ConcurrentReadAccessControl
         visitor.visit(testRoot);
 
         for (int i = 0; i < bgReaders; i++) {
-            addBackgroundJob(new RandomRead(getTestSession(), false));
+            addBackgroundJob(new RandomRead(getTestSession()));
         }
     }
 
     @Override
     protected void runTest() throws Exception {
         Session testSession = getTestSession();
-        RandomRead randomRead = new RandomRead(testSession, true);
+        RandomRead randomRead = new RandomRead(testSession);
         randomRead.run();
         testSession.logout();
     }
@@ -106,15 +107,14 @@ public class ConcurrentReadAccessControl
     private class RandomRead implements Runnable {
 
         private final Session testSession;
-        private final boolean doReport;
 
-        private RandomRead(Session testSession, boolean doReport) {
+        private RandomRead(Session testSession) {
             this.testSession = testSession;
-            this.doReport = doReport;
         }
+
         public void run() {
             try {
-                randomRead(testSession, allPaths, itemsToRead, doReport);
+                randomRead(testSession, allPaths, itemsToRead);
             } 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=1525690&r1=1525689&r2=1525690&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
Mon Sep 23 20:37:29 2013
@@ -24,8 +24,9 @@ import javax.jcr.Session;
  */
 public class ConcurrentReadDeepTreeTest extends AbstractDeepTreeTest {
 
-    public ConcurrentReadDeepTreeTest(boolean runAsAdmin, int itemsToRead, int bgReaders)
{
-        super(runAsAdmin, itemsToRead, bgReaders);
+    public ConcurrentReadDeepTreeTest(
+            boolean runAsAdmin, int itemsToRead, int bgReaders, boolean doReport) {
+        super(runAsAdmin, itemsToRead, bgReaders, doReport);
     }
 
     @Override
@@ -55,7 +56,7 @@ public class ConcurrentReadDeepTreeTest 
 
         public void run() {
             try {
-                randomRead(testSession, allPaths, itemsToRead, true);
+                randomRead(testSession, allPaths, itemsToRead);
             } 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=1525690&r1=1525689&r2=1525690&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
Mon Sep 23 20:37:29 2013
@@ -23,9 +23,11 @@ import javax.jcr.Session;
  */
 public class ReadDeepTreeTest extends AbstractDeepTreeTest {
 
-    public ReadDeepTreeTest(boolean runAsAdmin, int itemsToRead) {
-        super(runAsAdmin, itemsToRead, 0);
+    public ReadDeepTreeTest(
+            boolean runAsAdmin, int itemsToRead, boolean doReport) {
+        super(runAsAdmin, itemsToRead, 0, doReport);
     }
+
     @Override
     protected void beforeSuite() throws Exception {
         super.beforeSuite();
@@ -34,7 +36,7 @@ public class ReadDeepTreeTest extends Ab
     @Override
     protected void runTest() throws Exception {
         Session testSession = getTestSession();
-        randomRead(testSession, allPaths, itemsToRead, true);
+        randomRead(testSession, allPaths, itemsToRead);
         testSession.logout();
     }
 }
\ No newline at end of file



Mime
View raw message