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);
}
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);
}
}
}
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);
}
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);
}
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());
}
}
Aggregations