Search in sources :

Example 6 with ChainedOptionsBuilder

use of org.openjdk.jmh.runner.options.ChainedOptionsBuilder in project hive by apache.

the class BenchmarkTool method runAcidBenchmarks.

private void runAcidBenchmarks() {
    ChainedOptionsBuilder optsBuilder = new OptionsBuilder().warmupIterations(warmup).measurementIterations(spinCount).operationsPerInvocation(1).mode(Mode.SingleShotTime).timeUnit(TimeUnit.MILLISECONDS).forks(0).threads(nThreads).syncIterations(true);
    String[] candidates = new String[] { ACIDBenchmarks.TestOpenTxn.class.getSimpleName(), ACIDBenchmarks.TestLocking.class.getSimpleName(), ACIDBenchmarks.TestGetValidWriteIds.class.getSimpleName(), ACIDBenchmarks.TestAllocateTableWriteIds.class.getSimpleName() };
    for (String pattern : Util.filterMatches(Arrays.asList(candidates), matches, exclude)) {
        optsBuilder = optsBuilder.include(pattern);
    }
    Options opts = optsBuilder.param("howMany", Arrays.stream(instances).mapToObj(String::valueOf).toArray(String[]::new)).param("nPartitions", Arrays.stream(nParameters).mapToObj(String::valueOf).toArray(String[]::new)).build();
    try {
        new Runner(opts).run();
    } catch (RunnerException e) {
        LOG.error(e.getMessage(), e);
    }
}
Also used : Options(org.openjdk.jmh.runner.options.Options) Runner(org.openjdk.jmh.runner.Runner) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) RunnerException(org.openjdk.jmh.runner.RunnerException) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder)

Example 7 with ChainedOptionsBuilder

use of org.openjdk.jmh.runner.options.ChainedOptionsBuilder in project spring-data-mongodb by spring-projects.

the class AbstractMicrobenchmark method options.

/**
 * Collect all options for the {@link Runner}.
 *
 * @param includes regex for matching benchmarks to be included in the run.
 * @return never {@literal null}.
 * @throws Exception
 */
protected ChainedOptionsBuilder options(String includes) throws Exception {
    ChainedOptionsBuilder optionsBuilder = new OptionsBuilder().include(includes).jvmArgs(jvmArgs());
    optionsBuilder = warmup(optionsBuilder);
    optionsBuilder = measure(optionsBuilder);
    optionsBuilder = forks(optionsBuilder);
    optionsBuilder = report(optionsBuilder);
    return optionsBuilder;
}
Also used : ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder)

Example 8 with ChainedOptionsBuilder

use of org.openjdk.jmh.runner.options.ChainedOptionsBuilder in project Chronicle-Queue by OpenHFT.

the class ChronicleQueueMicrobench method newOptionsBuilder.

private ChainedOptionsBuilder newOptionsBuilder() {
    String className = getClass().getSimpleName();
    final ChainedOptionsBuilder runnerOptions = new OptionsBuilder().include(".*" + className + ".*").jvmArgs(BASE_JVM_ARGS).jvmArgsAppend(jvmArgs());
    if (getWarmupIterations() > 0) {
        runnerOptions.warmupIterations(getWarmupIterations());
    }
    if (getMeasureIterations() > 0) {
        runnerOptions.measurementIterations(getMeasureIterations());
    }
    if (null != getReportDir()) {
        String filePath = getReportDir() + className + ".json";
        File file = new File(filePath);
        if (file.exists()) {
            file.delete();
        } else {
            file.getParentFile().mkdirs();
        // file.createNewFile();
        }
        runnerOptions.resultFormat(ResultFormatType.JSON);
        runnerOptions.result(filePath);
    }
    return runnerOptions;
}
Also used : ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) File(java.io.File) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder)

Example 9 with ChainedOptionsBuilder

use of org.openjdk.jmh.runner.options.ChainedOptionsBuilder in project janusgraph by JanusGraph.

the class BenchmarkRunner method main.

public static void main(String[] args) throws RunnerException {
    final ChainedOptionsBuilder builder = new OptionsBuilder().forks(1).measurementTime(TimeValue.seconds(5)).warmupIterations(2).warmupTime(TimeValue.seconds(1));
    if (args.length > 0) {
        for (String arg : args) {
            builder.include(arg);
        }
    } else {
        builder.include(".*Benchmark");
    }
    new Runner(builder.build()).run();
}
Also used : Runner(org.openjdk.jmh.runner.Runner) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder)

Example 10 with ChainedOptionsBuilder

use of org.openjdk.jmh.runner.options.ChainedOptionsBuilder in project core-ng-demo-project by neowu.

the class Main method main.

public static void main(String[] args) throws RunnerException {
    ChainedOptionsBuilder builder = new OptionsBuilder().include(ASCIIToUpperCaseBenchmark.class.getSimpleName()).forks(1);
    // builder.addProfiler(StackProfiler.class)
    // .jvmArgsAppend("-Djmh.stack.lines=3");
    Options options = builder.build();
    new Runner(options).run();
}
Also used : Options(org.openjdk.jmh.runner.options.Options) Runner(org.openjdk.jmh.runner.Runner) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder)

Aggregations

ChainedOptionsBuilder (org.openjdk.jmh.runner.options.ChainedOptionsBuilder)14 OptionsBuilder (org.openjdk.jmh.runner.options.OptionsBuilder)13 Runner (org.openjdk.jmh.runner.Runner)9 File (java.io.File)3 RunnerException (org.openjdk.jmh.runner.RunnerException)3 ArrayList (java.util.ArrayList)2 BenchmarkFinder (jenkins.benchmark.jmh.BenchmarkFinder)2 Test (org.junit.Test)2 Options (org.openjdk.jmh.runner.options.Options)2 GraknSystemProperty (ai.grakn.GraknSystemProperty)1 BenchmarkParams (org.openjdk.jmh.infra.BenchmarkParams)1 GCProfiler (org.openjdk.jmh.profile.GCProfiler)1 StackProfiler (org.openjdk.jmh.profile.StackProfiler)1 RunResult (org.openjdk.jmh.results.RunResult)1