org.openjdk.jmh.runner.options.CommandLineOptions Java Examples

The following examples show how to use org.openjdk.jmh.runner.options.CommandLineOptions. 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: Benchmarks.java    From sdn-rx with Apache License 2.0 5 votes vote down vote up
public static void main(String... args) throws RunnerException, CommandLineOptionException {

		CommandLineOptions commandLineOptions = new CommandLineOptions(args);
		ChainedOptionsBuilder builder = new OptionsBuilder().parent(commandLineOptions)
			.include(Benchmarks.class.getSimpleName())
			.jvmArgsAppend("-ea");

		new Runner(builder.build()).run();
	}
 
Example #2
Source File: Benchmarks.java    From sdn-rx with Apache License 2.0 5 votes vote down vote up
public static void main(String... args) throws RunnerException, CommandLineOptionException {

		CommandLineOptions commandLineOptions = new CommandLineOptions(args);
		ChainedOptionsBuilder builder = new OptionsBuilder().parent(commandLineOptions)
			.include(Benchmarks.class.getSimpleName())
			.jvmArgsAppend("-ea");

		new Runner(builder.build()).run();
	}
 
Example #3
Source File: Benchmarks.java    From sdn-rx with Apache License 2.0 5 votes vote down vote up
public static void main(String... args) throws RunnerException, CommandLineOptionException {

		CommandLineOptions commandLineOptions = new CommandLineOptions(args);
		ChainedOptionsBuilder builder = new OptionsBuilder().parent(commandLineOptions)
			.include(Benchmarks.class.getSimpleName())
			.jvmArgsAppend("-ea");

		new Runner(builder.build()).run();
	}
 
Example #4
Source File: Benchmarks.java    From sdn-rx with Apache License 2.0 5 votes vote down vote up
public static void main(String... args) throws RunnerException, CommandLineOptionException {

		CommandLineOptions commandLineOptions = new CommandLineOptions(args);
		ChainedOptionsBuilder builder = new OptionsBuilder().parent(commandLineOptions)
			.include(Benchmarks.class.getSimpleName())
			.jvmArgsAppend("-ea");

		new Runner(builder.build()).run();
	}
 
Example #5
Source File: V2OptimizedClientCreationBenchmark.java    From aws-sdk-java-v2 with Apache License 2.0 5 votes vote down vote up
public static void main(String... args) throws RunnerException, CommandLineOptionException {
    Options opt = new OptionsBuilder()
        .parent(new CommandLineOptions())
        .include(V2OptimizedClientCreationBenchmark.class.getSimpleName())
        .addProfiler(StackProfiler.class)
        .build();
    Collection<RunResult> run = new Runner(opt).run();
}
 
Example #6
Source File: V1ClientCreationBenchmark.java    From aws-sdk-java-v2 with Apache License 2.0 5 votes vote down vote up
public static void main(String... args) throws RunnerException, CommandLineOptionException {
    Options opt = new OptionsBuilder()
        .parent(new CommandLineOptions())
        .include(V1ClientCreationBenchmark.class.getSimpleName())
        .addProfiler(StackProfiler.class)
        .build();
    Collection<RunResult> run = new Runner(opt).run();
}
 
Example #7
Source File: V2DefaultClientCreationBenchmark.java    From aws-sdk-java-v2 with Apache License 2.0 5 votes vote down vote up
public static void main(String... args) throws RunnerException, CommandLineOptionException {
    Options opt = new OptionsBuilder()
        .parent(new CommandLineOptions())
        .include(V2DefaultClientCreationBenchmark.class.getSimpleName())
        .addProfiler(StackProfiler.class)
        .build();
    Collection<RunResult> run = new Runner(opt).run();
}
 
Example #8
Source File: PegDownBenchmark.java    From commonmark-java with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    Options options = new OptionsBuilder()
            .parent(new CommandLineOptions(args))
            .include(PegDownBenchmark.class.getName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example #9
Source File: SpecBenchmark.java    From commonmark-java with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    Options options = new OptionsBuilder()
            .parent(new CommandLineOptions(args))
            .include(SpecBenchmark.class.getName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example #10
Source File: QueryBenchmark.java    From rya with Apache License 2.0 4 votes vote down vote up
/**
 * Runs the query benchmarks.
 * </p>
 * Example command line:
 * <pre>
 * java -cp benchmarks.jar org.apache.rya.benchmark.query.QueryBenchmark
 * </pre>
 *
 * @param args - The command line arguments that will be fed into the benchmark.
 * @throws Exception The benchmark could not be run.
 */
public static void main(final String[] args) throws Exception {
    // Read the queries that will be benchmarked from the provided path.
    final InputStream queriesStream = Files.newInputStream( QUERY_BENCHMARK_CONFIGURATION_FILE );
    final QueriesBenchmarkConf benchmarkConf = new QueriesBenchmarkConfReader().load(queriesStream);
    final Parameters parameters = benchmarkConf.getParameters();

    // Setup the options that will be used to run the benchmark.
    final OptionsBuilder options = new OptionsBuilder();
    options.parent( new CommandLineOptions(args) );
    options.include(QueryBenchmark.class.getSimpleName());

    // Provide the SPARQL queries that will be injected into the benchmark's 'sparql' parameter.
    final List<String> sparql = parameters.getQueries().getSPARQL();
    final String[] sparqlArray = new String[ sparql.size() ];
    sparql.toArray( sparqlArray );

    // Clean up the sparql's whitespace.
    for(int i = 0; i < sparqlArray.length; i++) {
        sparqlArray[i] = sparqlArray[i].trim();
    }

    options.param("sparql", sparqlArray);

    // If numReadsRuns was specified, inject them into the benchmark's 'numReads' parameter.
    final NumReadsRuns numReadsRuns = parameters.getNumReadsRuns();
    if(numReadsRuns != null) {
        // Validate the list.
        final List<String> numReadsList = numReadsRuns.getNumReads();
        for(final String numReads : numReadsList) {
            // It may be the READ_ALL flag.
            if(numReads.equals(READ_ALL)) {
                continue;
            }

            // Or it must be a Long.
            try {
                Long.parseLong(numReads);
            } catch(final NumberFormatException e) {
                throw new RuntimeException("There is a problem with the benchmark's configuration. Encountered " +
                        "a numReads value of '" + numReads + "', which is inavlid. The value must be a Long or " +
                        "'" + READ_ALL + "'");
            }
        }

        // Configure the benchmark with the numRuns.
        final String[] numReadsArray = new String[ numReadsList.size() ];
        numReadsList.toArray( numReadsArray );
        options.param("numReads", numReadsArray);
    }

    // Execute the benchmark.
    new Runner(options.build()).run();
}
 
Example #11
Source File: PCJOptimizerBenchmark.java    From rya with Apache License 2.0 3 votes vote down vote up
/**
 * Runs the PCJOptimizer benchmarks.
 * </p>
 * Example command line:
 * <pre>
 * java -cp benchmarks.jar org.apache.rya.benchmark.query.PCJOptimizerBenchmark
 * </pre>
 *
 * @param args - The command line arguments that will be fed into the benchmark.
 * @throws Exception The benchmark could not be run.
 */
public static void main(final String[] args) throws RunnerException, MalformedQueryException, CommandLineOptionException {
    final OptionsBuilder opts = new OptionsBuilder();
    opts.parent( new CommandLineOptions(args) );
    opts.include(PCJOptimizerBenchmark.class.getSimpleName());

    new Runner(opts.build()).run();
}