public abstract class ScalabilityAbstractSuite extends Object implements ScalabilitySuite, CSVResultGenerator
beforeSuite() - To configure the whole suite before the tests are started.
afterSuite() - To shutdown the whole suite after all tests are finished.
beforeIteration(ExecutionContext) - Any initialization to be performed before each of
the test run. Typically, this can be configured to create additional loads for each iteration.
This method will be called before each test iteration begins.
afterIteration() - To configure any post test steps to be executed after each iteration
of the test. This method will be called after each test iteration completes.
executeBenchmark(ScalabilityBenchmark, ExecutionContext) - Actual benchmark/test to be
executed. This method will be called in each iteration of the test run.
The following system JVM properties can be defined to configure the suite.
profile - Controls whether to profile the benchmark or not. Defaults to false.
noWarmup - Controls whether to run warmup or not before each benchmark. Defaults to false.
increments - Comma separated list which controls the incremental load for each iteration.
Defaults to 1,2,5.
| Modifier and Type | Class and Description |
|---|---|
static class |
ScalabilityAbstractSuite.ExecutionContext
Execution context to be pass information to and from the suite to the benchmarks.
|
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,ScalabilityBenchmark> |
benchmarks |
protected static Credentials |
CREDENTIALS |
static String |
CTX_SEARCH_PATHS_PROP |
protected static List<String> |
INCREMENTS
Controls the incremental load for each iteration
|
protected static org.slf4j.Logger |
LOG |
protected static boolean |
PROFILE |
protected static String |
TEST_ID
A random string to guarantee concurrently running tests don't overwrite
each others changes (for example in a cluster).
|
protected static boolean |
WARMUP |
| Modifier | Constructor and Description |
|---|---|
protected |
ScalabilityAbstractSuite() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBackgroundJob(Runnable job)
Adds a background thread that repeatedly executes the given job
until all the iterations of this test have been executed.
|
protected void |
afterIteration()
Run after all iterations of this test have been executed.
|
protected void |
afterSuite()
Cleanup after the benchmarks are run.
|
void |
beforeIteration(ScalabilityAbstractSuite.ExecutionContext context)
Executes once for each iteration.
|
protected void |
beforeSuite()
Setup any options before the benchmarks.
|
protected Repository[] |
createRepository(RepositoryFixture fixture) |
protected abstract void |
executeBenchmark(ScalabilityBenchmark benchmark,
ScalabilityAbstractSuite.ExecutionContext context)
Runs the benchmark.
|
Map<String,ScalabilityBenchmark> |
getBenchmarks() |
protected Repository |
getRepository() |
protected void |
initBackgroundJobs()
Sets the running flag to true.
|
protected Session |
loginWriter()
Returns a new writer session that will be automatically closed once
all the iterations of this test have been executed.
|
boolean |
removeBenchmark(String benchmark)
Removes the benchmark.
|
void |
run(Iterable<RepositoryFixture> fixtures) |
void |
setPrintStream(PrintStream out) |
void |
setUp(Repository repository,
RepositoryFixture fixture,
Credentials credentials)
Prepares this performance benchmark.
|
protected void |
shutdownBackgroundJobs()
Shutdown the background threads.
|
void |
tearDown()
Cleans up after this performance benchmark.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddBenchmarkspublic static final String CTX_SEARCH_PATHS_PROP
protected static final org.slf4j.Logger LOG
protected static final String TEST_ID
The probability of duplicates, for 50 concurrent processes, is less than 1 in 1 million.
protected static final boolean PROFILE
protected static final boolean WARMUP
protected static final List<String> INCREMENTS
protected static final Credentials CREDENTIALS
protected Map<String,ScalabilityBenchmark> benchmarks
public void run(Iterable<RepositoryFixture> fixtures)
run in interface ScalabilitySuiteprotected void beforeSuite()
throws Exception
Exceptionpublic void setUp(Repository repository, RepositoryFixture fixture, Credentials credentials) throws Exception
repository - the repository to usefixture - credentials of a user with write accessException - if the benchmark can not be preparedprotected void afterSuite()
throws Exception
Exceptionpublic void tearDown()
throws Exception
Exception - if the benchmark can not be cleaned uppublic boolean removeBenchmark(String benchmark)
removeBenchmark in interface ScalabilitySuitepublic Map<String,ScalabilityBenchmark> getBenchmarks()
getBenchmarks in interface ScalabilitySuiteprotected abstract void executeBenchmark(ScalabilityBenchmark benchmark, ScalabilityAbstractSuite.ExecutionContext context) throws Exception
benchmark - the benchmark to executeExceptionpublic void beforeIteration(ScalabilityAbstractSuite.ExecutionContext context) throws Exception
context - the contextException - the repository exceptionprotected void afterIteration()
throws Exception
Exception - if an error occursprotected void addBackgroundJob(Runnable job)
job - background jobprotected void initBackgroundJobs()
protected void shutdownBackgroundJobs()
throws InterruptedException
InterruptedExceptionprotected Repository[] createRepository(RepositoryFixture fixture) throws Exception
Exceptionprotected Session loginWriter()
public void setPrintStream(PrintStream out)
setPrintStream in interface CSVResultGeneratorprotected Repository getRepository()
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.