diff --git a/oak-benchmarks/README.md b/oak-benchmarks/README.md index 167b8c0247..fb18dbb6a8 100644 --- a/oak-benchmarks/README.md +++ b/oak-benchmarks/README.md @@ -80,6 +80,7 @@ Some system properties are also used to control the benchmarks. For example: -Dwarmup=5 - warmup time (in seconds) -Druntime=60 - how long a single benchmark should run (in seconds) -Dprofile=true - to collect and print profiling data + -Doak.benchmark.delay - (since Oak 1.40.0) time delay before single benchmark starts execution (in seconds) The test case names like `ReadPropertyTest`, `SmallFileReadTest` and `SmallFileWriteTest` indicate the specific test case being run. You can diff --git a/oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java b/oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java index 0da405a523..d530458000 100644 --- a/oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java +++ b/oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java @@ -74,6 +74,8 @@ public abstract class AbstractTest extends Benchmark implements CSVResultGene private static final long RUNTIME = TimeUnit.SECONDS.toMillis(Long.getLong("runtime", 60)); + private static final long TEST_DELAY = TimeUnit.SECONDS.toMillis(Long.getLong("oak.benchmark.delay", 0)); + private static final boolean SKIP_WARMPUP = Boolean.getBoolean("skipWarmup"); private static final boolean PROFILE = Boolean.getBoolean("profile"); @@ -200,6 +202,9 @@ public abstract class AbstractTest extends Benchmark implements CSVResultGene for (RepositoryFixture fixture : fixtures) { currentFixture = fixture; try { + if (TEST_DELAY > 0) { + Thread.sleep(TEST_DELAY); + } Repository[] cluster = createRepository(fixture); try { runTest(fixture, cluster[0], concurrencyLevels);