Search in sources :

Example 1 with BenchmarkParams

use of org.openjdk.jmh.infra.BenchmarkParams in project atlasdb by palantir.

the class PerformanceResultsTest method createBenchmarkParams.

private static BenchmarkParams createBenchmarkParams(String benchmarkName, String paramKey, String paramValue) {
    WorkloadParams workloadParams = new WorkloadParams();
    workloadParams.put(paramKey, paramValue, 0);
    // Sorry, JMH API doesn't have a builder. Isolating the badness to just here.
    return new BenchmarkParams(benchmarkName, null, false, 0, null, null, 1, 1, null, null, null, workloadParams, null, 1, null, null, null);
}
Also used : WorkloadParams(org.openjdk.jmh.runner.WorkloadParams) BenchmarkParams(org.openjdk.jmh.infra.BenchmarkParams)

Example 2 with BenchmarkParams

use of org.openjdk.jmh.infra.BenchmarkParams in project h2o-3 by h2oai.

the class H2OResultFormat method writeOut.

@Override
public void writeOut(Collection<RunResult> results) {
    SortedSet<String> params = new TreeSet<String>();
    for (RunResult res : results) {
        params.addAll(res.getParams().getParamsKeys());
    }
    printHeader(params);
    for (RunResult rr : results) {
        BenchmarkParams benchParams = rr.getParams();
        Result res = rr.getPrimaryResult();
        printLine(sha, date, benchParams.getBenchmark(), benchParams, params, res);
        for (String label : rr.getSecondaryResults().keySet()) {
            Result subRes = rr.getSecondaryResults().get(label);
            printLine(sha, date, benchParams.getBenchmark() + ":" + subRes.getLabel(), benchParams, params, subRes);
        }
    }
}
Also used : TreeSet(java.util.TreeSet) RunResult(org.openjdk.jmh.results.RunResult) BenchmarkParams(org.openjdk.jmh.infra.BenchmarkParams) RunResult(org.openjdk.jmh.results.RunResult) Result(org.openjdk.jmh.results.Result)

Example 3 with BenchmarkParams

use of org.openjdk.jmh.infra.BenchmarkParams in project atlasdb by palantir.

the class PerformanceResultsTest method canGenerateBenchmarkNameForTestWithoutKeyValueService.

@Test
public void canGenerateBenchmarkNameForTestWithoutKeyValueService() {
    BenchmarkParams params = createBenchmarkParams(FULL_BENCHMARK_NAME, "foo", "bar");
    assertThat(PerformanceResults.getBenchmarkName(params)).isEqualTo(FORMATTED_BENCHMARK_NAME_AGNOSTIC);
}
Also used : BenchmarkParams(org.openjdk.jmh.infra.BenchmarkParams) Test(org.junit.Test)

Example 4 with BenchmarkParams

use of org.openjdk.jmh.infra.BenchmarkParams in project atlasdb by palantir.

the class PerformanceResultsTest method canGenerateBenchmarkNameForTestWithKeyValueService.

@Test
public void canGenerateBenchmarkNameForTestWithKeyValueService() {
    BenchmarkParams params = createBenchmarkParams("PerformanceResults.doStuff", BenchmarkParam.URI.getKey(), DOCKERIZED_CASSANDRA_URI);
    assertThat(PerformanceResults.getBenchmarkName(params)).isEqualTo(FORMATTED_BENCHMARK_NAME_CASSANDRA);
}
Also used : BenchmarkParams(org.openjdk.jmh.infra.BenchmarkParams) Test(org.junit.Test)

Example 5 with BenchmarkParams

use of org.openjdk.jmh.infra.BenchmarkParams in project ignite by apache.

the class JmhWaitStategyBenchmark method main.

/**
 * Benchmark runner
 */
public static void main(String[] args) throws RunnerException {
    List<String> policies = Arrays.asList("inc", "dec", "r25", "r50", "r75");
    int[] threads = { 2, 4, 8, 16, 32 };
    List<RunResult> results = new ArrayList<>();
    for (String policy : policies) {
        for (int thread : threads) {
            ChainedOptionsBuilder builder = new OptionsBuilder().jvmArgs().timeUnit(TimeUnit.MILLISECONDS).measurementIterations(10).measurementTime(TimeValue.seconds(20)).warmupIterations(5).warmupTime(TimeValue.seconds(10)).jvmArgs("-Dbench.exp.policy=" + policy).forks(1).threads(thread).mode(Mode.Throughput).include(JmhWaitStategyBenchmark.class.getSimpleName());
            results.addAll(new Runner(builder.build()).run());
        }
    }
    for (RunResult result : results) {
        BenchmarkParams params = result.getParams();
        Collection<String> args1 = params.getJvmArgs();
        for (String s : args1) {
            System.out.print(s.substring(s.length() - 3, s.length()));
            System.out.print(" x ");
        }
        System.out.print(params.getThreads());
        System.out.print("\t\t");
        System.out.println(result.getPrimaryResult().toString());
    }
}
Also used : Runner(org.openjdk.jmh.runner.Runner) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) ArrayList(java.util.ArrayList) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder) RunResult(org.openjdk.jmh.results.RunResult) BenchmarkParams(org.openjdk.jmh.infra.BenchmarkParams)

Aggregations

BenchmarkParams (org.openjdk.jmh.infra.BenchmarkParams)5 Test (org.junit.Test)2 RunResult (org.openjdk.jmh.results.RunResult)2 ArrayList (java.util.ArrayList)1 TreeSet (java.util.TreeSet)1 Result (org.openjdk.jmh.results.Result)1 Runner (org.openjdk.jmh.runner.Runner)1 WorkloadParams (org.openjdk.jmh.runner.WorkloadParams)1 ChainedOptionsBuilder (org.openjdk.jmh.runner.options.ChainedOptionsBuilder)1 OptionsBuilder (org.openjdk.jmh.runner.options.OptionsBuilder)1