Search in sources :

Example 1 with ScalabilityBenchmark

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));
        }
    }
}
Also used : SynchronizedDescriptiveStatistics(org.apache.commons.math.stat.descriptive.SynchronizedDescriptiveStatistics) ScalabilityBenchmark(org.apache.jackrabbit.oak.scalability.benchmarks.ScalabilityBenchmark) Stopwatch(com.google.common.base.Stopwatch)

Example 2 with ScalabilityBenchmark

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);
        }
    }
}
Also used : ScalabilityBenchmark(org.apache.jackrabbit.oak.scalability.benchmarks.ScalabilityBenchmark)

Aggregations

ScalabilityBenchmark (org.apache.jackrabbit.oak.scalability.benchmarks.ScalabilityBenchmark)2 Stopwatch (com.google.common.base.Stopwatch)1 SynchronizedDescriptiveStatistics (org.apache.commons.math.stat.descriptive.SynchronizedDescriptiveStatistics)1