use of org.apache.jackrabbit.oak.scalability.benchmarks.ScalabilityBenchmark in project jackrabbit-oak by apache.
the class ScalabilityAbstractSuite method runIteration.
/**
* Runs the iteration of the benchmarks added.
*
* @param context the execution context
* @throws Exception
*/
private void runIteration(ExecutionContext context) throws Exception {
Preconditions.checkArgument(benchmarks != null && !benchmarks.isEmpty(), "No Benchmarks configured");
for (String key : benchmarks.keySet()) {
ScalabilityBenchmark benchmark = benchmarks.get(key);
if (result.getBenchmarkStatistics(benchmark) == null) {
result.addBenchmarkStatistics(benchmark, new SynchronizedDescriptiveStatistics());
}
Stopwatch watch = Stopwatch.createStarted();
executeBenchmark(benchmark, context);
watch.stop();
result.getBenchmarkStatistics(benchmark).addValue(watch.elapsed(TimeUnit.MILLISECONDS));
if (LOG.isDebugEnabled()) {
LOG.debug("Execution time for " + benchmark + "-" + watch.elapsed(TimeUnit.MILLISECONDS));
}
}
}
use of org.apache.jackrabbit.oak.scalability.benchmarks.ScalabilityBenchmark in project jackrabbit-oak by apache.
the class ScalabilityAbstractSuite method setupIteration.
/**
* Setup the iteration. Calls {@link #beforeIteration(ExecutionContext)} which can be
* overridden by subclasses.
*
* @param increment the current iteration's increment
* @throws Exception
*/
private void setupIteration(String increment) throws Exception {
if (LOG.isDebugEnabled()) {
LOG.debug("Start load : " + increment);
}
initBackgroundJobs();
// create the load for this iteration
beforeIteration(context);
if (WARMUP) {
for (ScalabilityBenchmark benchmark : benchmarks.values()) {
executeBenchmark(benchmark, context);
}
}
}
Aggregations