Package org.openjdk.jmh.runner
Class Runner
- java.lang.Object
-
- org.openjdk.jmh.runner.Runner
-
public class Runner extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected Optionsoptionsprotected OutputFormatout
-
Constructor Summary
Constructors Constructor Description Runner(Options options)Create Runner with the given options.Runner(Options options, OutputFormat format)Create runner with the custom OutputFormat.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidetaAfterBenchmark(BenchmarkParams params)protected voidetaAfterBenchmarks()protected voidetaBeforeBenchmark()protected voidetaBeforeBenchmarks(Collection<ActionPlan> plans)voidlist()Print matching benchmarks into output.voidlistWithParams(CommandLineOptions options)Print matching benchmarks with parameters into output.Collection<RunResult>run()Run benchmarks.protected voidrunBenchmark(BenchmarkParams benchParams, org.openjdk.jmh.runner.BenchmarkHandler handler, org.openjdk.jmh.runner.IterationResultAcceptor acceptor)protected Multimap<BenchmarkParams,BenchmarkResult>runBenchmarksEmbedded(ActionPlan actionPlan)protected voidrunBenchmarksForked(ActionPlan actionPlan, org.openjdk.jmh.runner.IterationResultAcceptor acceptor)RunResultrunSingle()Shortcut method for the single benchmark execution.booleanrunSystemGC()Execute System.gc() if we the System.gc option is set.
-
-
-
Field Detail
-
options
protected final Options options
-
out
protected final OutputFormat out
-
-
Constructor Detail
-
Runner
public Runner(Options options, OutputFormat format)
Create runner with the custom OutputFormat.- Parameters:
options- options to useformat- OutputFormat to use
-
Runner
public Runner(Options options)
Create Runner with the given options. This method sets up theOutputFormatas mandated by options.- Parameters:
options- options to use.
-
-
Method Detail
-
list
public void list()
Print matching benchmarks into output.
-
listWithParams
public void listWithParams(CommandLineOptions options)
Print matching benchmarks with parameters into output.- Parameters:
options- options to use.
-
runSingle
public RunResult runSingle() throws RunnerException
Shortcut method for the single benchmark execution. This method is handy when Options describe only the single benchmark to run.- Returns:
- benchmark result
- Throws:
RunnerException- if more than one benchmark is found, or no results are returned
-
run
public Collection<RunResult> run() throws RunnerException
Run benchmarks.- Returns:
- map of benchmark results
- Throws:
RunnerException- if something goes wrong
-
runBenchmarksForked
protected void runBenchmarksForked(ActionPlan actionPlan, org.openjdk.jmh.runner.IterationResultAcceptor acceptor)
-
runBenchmarksEmbedded
protected Multimap<BenchmarkParams,BenchmarkResult> runBenchmarksEmbedded(ActionPlan actionPlan)
-
etaAfterBenchmark
protected void etaAfterBenchmark(BenchmarkParams params)
-
etaBeforeBenchmarks
protected void etaBeforeBenchmarks(Collection<ActionPlan> plans)
-
etaBeforeBenchmark
protected void etaBeforeBenchmark()
-
etaAfterBenchmarks
protected void etaAfterBenchmarks()
-
runBenchmark
protected void runBenchmark(BenchmarkParams benchParams, org.openjdk.jmh.runner.BenchmarkHandler handler, org.openjdk.jmh.runner.IterationResultAcceptor acceptor)
-
runSystemGC
public boolean runSystemGC()
Execute System.gc() if we the System.gc option is set.- Returns:
- true if we did
-
-