Package org.openjdk.jmh.runner
Class Runner
- java.lang.Object
-
- org.openjdk.jmh.runner.BaseRunner
-
- org.openjdk.jmh.runner.Runner
-
public class Runner extends BaseRunner
-
-
Field Summary
Fields Modifier and Type Field Description private int
cpuCount
private static java.lang.String
JMH_LOCK_FILE
private static java.lang.Boolean
JMH_LOCK_IGNORE
private BenchmarkList
list
private static int
TAIL_LINES_ON_ERROR
-
Fields inherited from class org.openjdk.jmh.runner.BaseRunner
options, 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 Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addClasspath(java.util.List<java.lang.String> command)
private static OutputFormat
createOutputFormat(Options options)
private java.util.List<IterationResult>
doFork(BinaryLinkServer reader, java.util.List<java.lang.String> commandString, java.io.File stdOut, java.io.File stdErr, boolean printOut, boolean printErr)
private java.util.List<WorkloadParams>
explodeAllParams(BenchmarkListEntry br)
private java.util.List<ActionPlan>
getActionPlans(java.util.Set<BenchmarkListEntry> benchmarks)
(package private) java.util.List<java.lang.String>
getForkedMainCommand(BenchmarkParams benchmark, java.util.List<ExternalProfiler> profilers, java.lang.String host, int port)
private java.util.List<java.lang.String>
getPrintPropertiesCommand(java.lang.String jvm)
private java.util.Collection<RunResult>
internalRun()
void
list()
Print matching benchmarks into output.void
listWithParams(CommandLineOptions options)
Print matching benchmarks with parameters into output.private java.util.SortedSet<RunResult>
mergeRunResults(Multimap<BenchmarkParams,BenchmarkResult> results)
private Action
newAction(BenchmarkListEntry br, ActionMode mode)
private BenchmarkParams
newBenchmarkParams(BenchmarkListEntry benchmark, ActionMode mode)
java.util.Collection<RunResult>
run()
Run benchmarks.private java.util.Collection<RunResult>
runBenchmarks(java.util.SortedSet<BenchmarkListEntry> benchmarks)
private Multimap<BenchmarkParams,BenchmarkResult>
runSeparate(ActionPlan actionPlan)
RunResult
runSingle()
Shortcut method for the single benchmark execution.-
Methods inherited from class org.openjdk.jmh.runner.BaseRunner
etaAfterBenchmark, etaAfterBenchmarks, etaBeforeBenchmark, etaBeforeBenchmarks, runBenchmark, runBenchmark, runBenchmarksEmbedded, runBenchmarksForked, runSystemGC
-
-
-
-
Field Detail
-
TAIL_LINES_ON_ERROR
private static final int TAIL_LINES_ON_ERROR
-
JMH_LOCK_FILE
private static final java.lang.String JMH_LOCK_FILE
-
JMH_LOCK_IGNORE
private static final java.lang.Boolean JMH_LOCK_IGNORE
-
list
private final BenchmarkList list
-
cpuCount
private int cpuCount
-
-
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
-
createOutputFormat
private static OutputFormat createOutputFormat(Options options)
-
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 java.util.Collection<RunResult> run() throws RunnerException
Run benchmarks.- Returns:
- map of benchmark results
- Throws:
RunnerException
- if something goes wrong
-
internalRun
private java.util.Collection<RunResult> internalRun() throws RunnerException
- Throws:
RunnerException
-
getActionPlans
private java.util.List<ActionPlan> getActionPlans(java.util.Set<BenchmarkListEntry> benchmarks)
-
newAction
private Action newAction(BenchmarkListEntry br, ActionMode mode)
-
newBenchmarkParams
private BenchmarkParams newBenchmarkParams(BenchmarkListEntry benchmark, ActionMode mode)
-
explodeAllParams
private java.util.List<WorkloadParams> explodeAllParams(BenchmarkListEntry br) throws RunnerException
- Throws:
RunnerException
-
runBenchmarks
private java.util.Collection<RunResult> runBenchmarks(java.util.SortedSet<BenchmarkListEntry> benchmarks) throws RunnerException
- Throws:
RunnerException
-
mergeRunResults
private java.util.SortedSet<RunResult> mergeRunResults(Multimap<BenchmarkParams,BenchmarkResult> results)
-
runSeparate
private Multimap<BenchmarkParams,BenchmarkResult> runSeparate(ActionPlan actionPlan)
-
doFork
private java.util.List<IterationResult> doFork(BinaryLinkServer reader, java.util.List<java.lang.String> commandString, java.io.File stdOut, java.io.File stdErr, boolean printOut, boolean printErr)
-
getForkedMainCommand
java.util.List<java.lang.String> getForkedMainCommand(BenchmarkParams benchmark, java.util.List<ExternalProfiler> profilers, java.lang.String host, int port)
- Parameters:
host
- host VM hostport
- host VM port- Returns:
-
getPrintPropertiesCommand
private java.util.List<java.lang.String> getPrintPropertiesCommand(java.lang.String jvm)
-
addClasspath
private void addClasspath(java.util.List<java.lang.String> command)
-
-