org.openjdk.jmh.runner.RunnerException Java Examples

The following examples show how to use org.openjdk.jmh.runner.RunnerException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FHIRBenchmarkRunner.java    From FHIR with Apache License 2.0 6 votes vote down vote up
/**
     * Run without overriding any parameters
     */
    public Collection<RunResult> run() throws RunnerException {
        Options opt = new OptionsBuilder()
                .include(".*" + benchmarkClass.getSimpleName() + ".*")
                .jvmArgsPrepend("-Xms2g", "-Xmx2g")
                .jvmArgsAppend(properties.toArray(new String[properties.size()]))
                .verbosity(VerboseMode.NORMAL)
                .warmupIterations(1)
                .warmupTime(TimeValue.seconds(10))
                .measurementIterations(2)
                .measurementTime(TimeValue.seconds(10))
                .shouldDoGC(true)
                .forks(2)
                .threads(1)
//              .mode(Mode.AverageTime)
                .addProfiler(StackProfiler.class)
                .build();
        return new Runner(opt).run();
    }
 
Example #2
Source File: BenchmarkGroupByHash.java    From presto with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    // assure the benchmarks are valid before running
    BenchmarkData data = new BenchmarkData();
    data.setup();
    new BenchmarkGroupByHash().groupByHashPreCompute(data);
    new BenchmarkGroupByHash().addPagePreCompute(data);

    SingleChannelBenchmarkData singleChannelBenchmarkData = new SingleChannelBenchmarkData();
    singleChannelBenchmarkData.setup();
    new BenchmarkGroupByHash().bigintGroupByHash(singleChannelBenchmarkData);

    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkGroupByHash.class.getSimpleName() + ".*")
            .addProfiler(GCProfiler.class)
            .jvmArgs("-Xmx10g")
            .build();
    new Runner(options).run();
}
 
Example #3
Source File: AppendEntriesBenchmark.java    From sofa-jraft with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    final int size = ThreadLocalRandom.current().nextInt(100, 1000);
    System.out.println(sendEntries1(256, size).length);
    System.out.println(sendEntries2(256, size).length);
    System.out.println(sendEntries3(256, size, AdaptiveBufAllocator.DEFAULT.newHandle()).length);
    System.out.println(sendEntries4(256, size).length);

    Options opt = new OptionsBuilder() //
        .include(AppendEntriesBenchmark.class.getSimpleName()) //
        .warmupIterations(1) //
        .warmupTime(TimeValue.seconds(5)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .threads(8) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #4
Source File: BenchmarkSTContains.java    From presto with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args)
        throws IOException, RunnerException
{
    // assure the benchmarks are valid before running
    BenchmarkData data = new BenchmarkData();
    data.setup();
    BenchmarkSTContains benchmark = new BenchmarkSTContains();
    if (!((Boolean) benchmark.stContainsInnerPoint(data)).booleanValue()) {
        throw new IllegalStateException("ST_Contains for inner point expected to return true, got false.");
    }

    if (((Boolean) benchmark.stContainsOuterPointInEnvelope(data)).booleanValue()) {
        throw new IllegalStateException("ST_Contains for outer point expected to return false, got true.");
    }

    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkSTContains.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example #5
Source File: SymSpellSearchBenchMark.java    From customized-symspell with MIT License 6 votes vote down vote up
@Test
public void testBenchmarkSearch() throws RunnerException, IOException {
  File file = checkFileAndCreate(SymSpellSearchBenchMark.class.getName());
  Options opt = new OptionsBuilder()
      .include(SymSpellSearchBenchMark.class.getSimpleName())
      .addProfiler(MemoryProfiler.class.getName())
      .resultFormat(ResultFormatType.JSON)
      .result(file.getAbsolutePath())
      .warmupIterations(0)
      .measurementIterations(1)
      .forks(1)
      .build();
  new Runner(opt).run();
  System.out.println("Total Lookup results instance " + totalMatches);

}
 
Example #6
Source File: SymSpellIndexBenchMark.java    From customized-symspell with MIT License 6 votes vote down vote up
@Test
public void testBenchmarkIndex() throws RunnerException, IOException {
  File file = checkFileAndCreate(SymSpellIndexBenchMark.class.getName());
  Options opt = new OptionsBuilder()
      .include(SymSpellIndexBenchMark.class.getSimpleName())
      .addProfiler(MemoryProfiler.class.getName())
      .resultFormat(ResultFormatType.JSON)
      .result(file.getAbsolutePath())
      .warmupIterations(0)
      .measurementIterations(1)
      .forks(1)
      .build();
  new Runner(opt).run();
  System.out.println("Total Lookup results instance " + totalMatches);

}
 
Example #7
Source File: FHIRBenchmarkRunner.java    From FHIR with Apache License 2.0 6 votes vote down vote up
/**
 * Run the benchmark with all the examples in BenchmarkUtil.SPEC_EXAMPLE_NAMES
 */
public Collection<RunResult> runAll() throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(".*" + benchmarkClass.getSimpleName() + ".*")
            .jvmArgsPrepend("-Xms4g", "-Xmx4g")
            .jvmArgsAppend(properties.toArray(new String[properties.size()]))
            .verbosity(VerboseMode.NORMAL)
            .warmupIterations(1)
            .warmupTime(TimeValue.seconds(10))
            .measurementIterations(1)
            .measurementTime(TimeValue.seconds(10))
            .shouldDoGC(true)
            .forks(1)
            .output("results.txt")
            .mode(Mode.SingleShotTime)
            .param("exampleName", BenchmarkUtil.SPEC_EXAMPLE_NAMES.toArray(new String[0])) // https://stackoverflow.com/a/4042464/161022
            .build();
    return new Runner(opt).run();
}
 
Example #8
Source File: FHIRBenchmarkRunner.java    From FHIR with Apache License 2.0 6 votes vote down vote up
/**
     * Run and override the 'exampleName' param with the passed fileName
     */
    public Collection<RunResult> run(String fileName) throws RunnerException {
        Options opt = new OptionsBuilder()
                .include(".*" + benchmarkClass.getSimpleName() + ".*")
                .jvmArgsPrepend("-Xms4g", "-Xmx4g")
                .jvmArgsAppend(properties.toArray(new String[properties.size()]))
                .verbosity(VerboseMode.NORMAL)
                .warmupIterations(1)
                .warmupTime(TimeValue.seconds(10))
                .measurementIterations(2)
                .measurementTime(TimeValue.seconds(10))
                .shouldDoGC(false)
                .forks(1)
//              .mode(Mode.AverageTime)
                .addProfiler(StackProfiler.class)
                .param("exampleName", fileName)
                .build();
        return new Runner(opt).run();
    }
 
Example #9
Source File: DateBenchmarkTest1.java    From mica-jmh with MIT License 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
	Options opts = new OptionsBuilder()
		.include(DateBenchmarkTest1.class.getSimpleName())
		.warmupIterations(5)
		.measurementIterations(5)
		.jvmArgs("-server")
		.forks(1)
		.resultFormat(ResultFormatType.TEXT)
		.build();
	new Runner(opts).run();
}
 
Example #10
Source File: SingleThreadExecutorBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    final Options opt = new OptionsBuilder() //
        .include(SingleThreadExecutorBenchmark.class.getSimpleName()) //
        .warmupIterations(3) //
        .measurementIterations(10) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #11
Source File: LongAdderBenchmark.java    From metrics with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(".*" + LongAdderBenchmark.class.getSimpleName() + ".*")
            .warmupIterations(3)
            .measurementIterations(5)
            .threads(32)
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
Example #12
Source File: DateBenchmarkDate.java    From mica-jmh with MIT License 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
	Options opts = new OptionsBuilder()
		.include(DateBenchmarkDate.class.getSimpleName())
		.warmupIterations(5)
		.measurementIterations(5)
		.jvmArgs("-server")
		.forks(1)
		.resultFormat(ResultFormatType.TEXT)
		.build();
	new Runner(opts).run();
}
 
Example #13
Source File: DateBenchmarkTest2.java    From mica-jmh with MIT License 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
	Options opts = new OptionsBuilder()
		.include(DateBenchmarkTest2.class.getSimpleName())
		.warmupIterations(5)
		.measurementIterations(5)
		.jvmArgs("-server")
		.forks(1)
		.resultFormat(ResultFormatType.TEXT)
		.build();
	new Runner(opts).run();
}
 
Example #14
Source File: JmhRunner.java    From distkv with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
  Options option = new OptionsBuilder()
          .include(DistkvStrBenchmark.class.getSimpleName())
          .include(RedisStrBenchmark.class.getSimpleName())
          .include(DistkvListBenchmark.class.getSimpleName())
          .warmupIterations(5)
          .measurementIterations(8)
          .forks(1)
          .build();
  new Runner(option).run();
}
 
Example #15
Source File: BucketCounterBenchmark.java    From metrics with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(".*" + BucketCounterBenchmark.class.getSimpleName() + ".*")
            .warmupIterations(3)
            .measurementIterations(5)
            .threads(32)
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
Example #16
Source File: MeterBenchMark.java    From metrics with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(".*" + MeterBenchMark.class.getSimpleName() + ".*")
            .warmupIterations(3)
            .measurementIterations(5)
            .threads(32)
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
Example #17
Source File: SimpleQuery.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(".*" + SimpleQuery.class.getSimpleName() + ".*")
            .warmupIterations(2)
            .measurementIterations(5)
            .forks(1)
            .jvmArgsAppend("-ea")
            .build();

    new Runner(opt).run();
}
 
Example #18
Source File: Genesis.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
  CommandLine commandLine = new CommandLine(new Genesis());
  commandLine.parse(args);
  if (commandLine.isUsageHelpRequested()) {
    commandLine.usage(System.out);
    return;
  }

  OptionsBuilder optionsBuilder = new OptionsBuilder();
  if (benchmarks != null) {
    // The OptionsBuilder#include takes a regular expression as argument.
    // Therefore it is important to keep the benchmark names unique for
    // running a benchmark. For example if there are two benchmarks -
    // BenchMarkOM and BenchMarkOMClient and we include BenchMarkOM then
    // both the benchmarks will be run.
    for (String benchmark : benchmarks) {
      optionsBuilder.include(benchmark);
    }
  }
  optionsBuilder.warmupIterations(2)
      .measurementIterations(20)
      .addProfiler(StackProfiler.class)
      .addProfiler(GCProfiler.class)
      .shouldDoGC(true)
      .forks(1)
      .threads(numThreads);

  if (seconds > 0) {
    optionsBuilder.measurementTime(seconds(seconds));
  }

  new Runner(optionsBuilder.build()).run();
}
 
Example #19
Source File: Utf8CodecBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder() //
        .include(Utf8CodecBenchmark.class.getSimpleName()) //
        .warmupIterations(3) //
        .warmupTime(TimeValue.seconds(10)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #20
Source File: AsciiCodecBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder() //
        .include(AsciiCodecBenchmark.class.getSimpleName()) //
        .warmupIterations(3) //
        .warmupTime(TimeValue.seconds(10)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #21
Source File: VarIntsBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder() //
        .include(VarIntsBenchmark.class.getSimpleName()) //
        .warmupIterations(3) //
        .warmupTime(TimeValue.seconds(10)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #22
Source File: RheaKVPutBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder() //
        .include(RheaKVPutBenchmark.class.getSimpleName()) //
        .warmupIterations(1) //
        .warmupTime(TimeValue.seconds(10)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .threads(CONCURRENCY) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #23
Source File: RheaKVGetBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder() //
        .include(RheaKVGetBenchmark.class.getSimpleName()) //
        .warmupIterations(1) //
        .warmupTime(TimeValue.seconds(10)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .threads(BenchmarkUtil.CONCURRENCY) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #24
Source File: RawKVApproximateBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder() //
        .include(RawKVApproximateBenchmark.class.getSimpleName()) //
        .warmupIterations(3) //
        .warmupTime(TimeValue.seconds(10)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .threads(CONCURRENCY) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #25
Source File: RawKVPutBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder() //
        .include(RawKVPutBenchmark.class.getSimpleName()) //
        .warmupIterations(1) //
        .warmupTime(TimeValue.seconds(10)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .threads(CONCURRENCY) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #26
Source File: RawKVGetBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder() //
        .include(RawKVGetBenchmark.class.getSimpleName()) //
        .warmupIterations(1) //
        .warmupTime(TimeValue.seconds(10)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .threads(CONCURRENCY) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #27
Source File: SimpleQuery.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
        Options opt = new OptionsBuilder()
                .include(".*" + SimpleQuery.class.getSimpleName() + ".*")
                .warmupIterations(3)
                .measurementIterations(4)
                .forks(1)
//                .jvmArgs("-agentpath:/Applications/YourKit-Java-Profiler-2019.8.app/Contents/Resources/bin/mac/libyjpagent.dylib")
                .build();

        new Runner(opt).run();
    }
 
Example #28
Source File: BenchmarkJtsGeometrySerde.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkJtsGeometrySerde.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example #29
Source File: BenchmarkGeometrySerde.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkGeometrySerde.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example #30
Source File: BenchmarkSTXMin.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkSTXMin.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}