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 Options
options
protected OutputFormat
out
-
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 void
etaAfterBenchmark(BenchmarkParams params)
protected void
etaAfterBenchmarks()
protected void
etaBeforeBenchmark()
protected void
etaBeforeBenchmarks(Collection<ActionPlan> plans)
void
list()
Print matching benchmarks into output.void
listWithParams(CommandLineOptions options)
Print matching benchmarks with parameters into output.Collection<RunResult>
run()
Run benchmarks.protected void
runBenchmark(BenchmarkParams benchParams, org.openjdk.jmh.runner.BenchmarkHandler handler, org.openjdk.jmh.runner.IterationResultAcceptor acceptor)
protected Multimap<BenchmarkParams,BenchmarkResult>
runBenchmarksEmbedded(ActionPlan actionPlan)
protected void
runBenchmarksForked(ActionPlan actionPlan, org.openjdk.jmh.runner.IterationResultAcceptor acceptor)
RunResult
runSingle()
Shortcut method for the single benchmark execution.boolean
runSystemGC()
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 theOutputFormat
as 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
-
-