Package org.openjdk.jmh.runner
Class Runner
java.lang.Object
org.openjdk.jmh.runner.BaseRunner
org.openjdk.jmh.runner.Runner
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private static final String
private static final Boolean
private final BenchmarkList
private static final int
Fields inherited from class org.openjdk.jmh.runner.BaseRunner
options, out
-
Constructor Summary
ConstructorsConstructorDescriptionCreate Runner with the given options.Runner
(Options options, OutputFormat format) Create runner with the custom OutputFormat. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addClasspath
(List<String> command) private static OutputFormat
createOutputFormat
(Options options) private List
<IterationResult> doFork
(BinaryLinkServer reader, List<String> commandString, File stdOut, File stdErr, boolean printOut, boolean printErr) private List
<WorkloadParams> private List
<ActionPlan> getActionPlans
(Set<BenchmarkListEntry> benchmarks) getForkedMainCommand
(BenchmarkParams benchmark, List<ExternalProfiler> profilers, String host, int port) private Collection
<RunResult> void
list()
Print matching benchmarks into output.void
listWithParams
(CommandLineOptions options) Print matching benchmarks with parameters into output.private Action
newAction
(BenchmarkListEntry br, ActionMode mode) private BenchmarkParams
newBenchmarkParams
(BenchmarkListEntry benchmark, ActionMode mode) run()
Run benchmarks.private Collection
<RunResult> runBenchmarks
(SortedSet<BenchmarkListEntry> benchmarks) private Multimap
<BenchmarkParams, BenchmarkResult> runSeparate
(ActionPlan actionPlan) 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 Details
-
TAIL_LINES_ON_ERROR
private static final int TAIL_LINES_ON_ERROR -
JMH_LOCK_FILE
-
JMH_LOCK_IGNORE
-
list
-
cpuCount
private int cpuCount
-
-
Constructor Details
-
Runner
Create runner with the custom OutputFormat.- Parameters:
options
- options to useformat
- OutputFormat to use
-
Runner
Create Runner with the given options. This method sets up theOutputFormat
as mandated by options.- Parameters:
options
- options to use.
-
-
Method Details
-
createOutputFormat
-
list
public void list()Print matching benchmarks into output. -
listWithParams
Print matching benchmarks with parameters into output.- Parameters:
options
- options to use.
-
runSingle
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
Run benchmarks.- Returns:
- map of benchmark results
- Throws:
RunnerException
- if something goes wrong
-
internalRun
- Throws:
RunnerException
-
getActionPlans
-
newAction
-
newBenchmarkParams
-
explodeAllParams
- Throws:
RunnerException
-
runBenchmarks
private Collection<RunResult> runBenchmarks(SortedSet<BenchmarkListEntry> benchmarks) throws RunnerException - Throws:
RunnerException
-
mergeRunResults
-
runSeparate
-
doFork
private List<IterationResult> doFork(BinaryLinkServer reader, List<String> commandString, File stdOut, File stdErr, boolean printOut, boolean printErr) -
getForkedMainCommand
List<String> getForkedMainCommand(BenchmarkParams benchmark, List<ExternalProfiler> profilers, String host, int port) - Parameters:
host
- host VM hostport
- host VM port- Returns:
-
getPrintPropertiesCommand
-
addClasspath
-