jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1535350 - in /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark: BenchmarkRunner.java ManyUserReadTest.java
Date Thu, 24 Oct 2013 12:27:05 GMT
Author: angela
Date: Thu Oct 24 12:27:05 2013
New Revision: 1535350

URL: http://svn.apache.org/r1535350
Log:
OAK-527: benchmark tests

Modified:
    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/ManyUserReadTest.java

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=1535350&r1=1535349&r2=1535350&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
Thu Oct 24 12:27:05 2013
@@ -67,6 +67,9 @@ public class BenchmarkRunner {
         OptionSpec<Boolean> report = parser.accepts("report", "Whether to output intermediate
results")
                 .withOptionalArg().ofType(Boolean.class)
                 .defaultsTo(Boolean.FALSE);
+        OptionSpec<Boolean> randomUser = parser.accepts("randomUser", "Whether to use
a random user to read.")
+                        .withOptionalArg().ofType(Boolean.class)
+                        .defaultsTo(Boolean.FALSE);
         OptionSpec<File> csvFile = parser.accepts("csvFile", "File to write a CSV version
of the benchmark data.")
                 .withOptionalArg().ofType(File.class);
 
@@ -145,7 +148,8 @@ public class BenchmarkRunner {
                     runAsAdmin.value(options),
                     itemsToRead.value(options),
                     bgReaders.value(options),
-                    report.value(options)),
+                    report.value(options),
+                    randomUser.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/ManyUserReadTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ManyUserReadTest.java?rev=1535350&r1=1535349&r2=1535350&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
Thu Oct 24 12:27:05 2013
@@ -35,9 +35,11 @@ public class ManyUserReadTest extends Re
 
     private final int numberOfUsers = 1000;
     private final int numberOfMembers = 10;
+    private final boolean randomUser;
 
-    protected ManyUserReadTest(boolean runAsAdmin, int itemsToRead, int bgReaders, boolean
doReport) {
+    protected ManyUserReadTest(boolean runAsAdmin, int itemsToRead, int bgReaders, boolean
doReport, boolean randomUser) {
         super(runAsAdmin, itemsToRead, bgReaders, doReport);
+        this.randomUser = randomUser;
     }
 
     @Override
@@ -97,7 +99,7 @@ public class ManyUserReadTest extends Re
         if (runAsAdmin) {
             return loginWriter();
         } else {
-            String userId = "user" + getIndex();
+            String userId = (randomUser) ? "user"+getIndex() : "user1";
             SimpleCredentials sc = new SimpleCredentials(userId, userId.toCharArray());
             return login(sc);
         }



Mime
View raw message