use of org.openjdk.jmh.results.RunResult in project cassandra by apache.
the class BatchStatementBench method main.
public static void main(String... args) throws Exception {
Options opts = new OptionsBuilder().include(".*" + BatchStatementBench.class.getSimpleName() + ".*").jvmArgs("-server").forks(1).mode(Mode.Throughput).addProfiler(GCProfiler.class).build();
Collection<RunResult> records = new Runner(opts).run();
for (RunResult result : records) {
Result r = result.getPrimaryResult();
System.out.println("API replied benchmark score: " + r.getScore() + " " + r.getScoreUnit() + " over " + r.getStatistics().getN() + " iterations");
}
}
use of org.openjdk.jmh.results.RunResult in project cassandra by apache.
the class MutationBench method main.
public static void main(String... args) throws Exception {
Options opts = new OptionsBuilder().include(".*" + MutationBench.class.getSimpleName() + ".*").jvmArgs("-server").forks(1).mode(Mode.Throughput).addProfiler(StackProfiler.class).build();
Collection<RunResult> records = new Runner(opts).run();
for (RunResult result : records) {
Result r = result.getPrimaryResult();
System.out.println("API replied benchmark score: " + r.getScore() + " " + r.getScoreUnit() + " over " + r.getStatistics().getN() + " iterations");
}
}
use of org.openjdk.jmh.results.RunResult 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());
}
}
use of org.openjdk.jmh.results.RunResult in project engineblock by engineblock.
the class SysPerfBaseliner method runBenchmarks.
private Collection<RunResult> runBenchmarks() {
// File jmhOut = File.createTempFile("jmh", "out");
// These are broken out simply to provide more friendly feedback to users.
Map<String, Class<?>> namedTests = new LinkedHashMap<>();
namedTests.put("nanotime", SysBenchMethodNanoTime.class);
namedTests.put("parknanos", SysBenchMethodParkNanos.class);
namedTests.put("sleep", SysBenchMethodThreadSleep.class);
Collection<RunResult> results = new ArrayList<>();
namedTests.forEach((n, c) -> {
try {
String logfile = Files.createTempFile("jmh_" + n, ".log").toString();
Options options = new OptionsBuilder().forks(1).include(c.getSimpleName()).output(logfile).build();
logger.info("running microbench for " + n + ", for about 20 seconds; details in " + logfile);
RunResult runResult = new Runner(options).runSingle();
results.add(runResult);
} catch (Exception e) {
throw new RuntimeException(e);
}
});
return results;
}
Aggregations