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