Package org.openjdk.jmh.runner.options
Class CommandLineOptions
java.lang.Object
org.openjdk.jmh.runner.options.CommandLineOptions
- All Implemented Interfaces:
Serializable
,Options
Class that handles all the command line options.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final Optional
<Collection<String>> private final Optional
<Collection<String>> private final Optional
<Collection<String>> private final boolean
private final boolean
private final boolean
private final boolean
private final joptsimple.OptionParser
private final List
<ProfilerConfig> private final Optional
<ResultFormatType> private static final long
private final Optional
<VerboseMode> private final Optional
<WarmupMode> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBenchmarks modes to execute.Which benchmarks to omit?Fork countWhich benchmarks to execute?getJvm()
JVM executable to use for forksJVM parameters to use with forksJVM parameters to use with forks (these options will be appended after any other JVM option)JVM parameters to use with forks (these options will be prepended before any other JVM option)Number of batch size for measurementNumber of measurement iterationsThe duration for measurement iterationsOperations per invocation.Which file to use for dumping the outputgetParameter
(String name) The overridden value of the parameter.Profilers to use for the run.Which file to use for dumping the resultResult format to useOptional
<int[]> Thread subgroups distribution.Number of threads to runTimeout: how long to wait for an iteration to complete.Timeunit to use in units.Number of batch size for warmupNumber of initial forks to ignore the results forWhich benchmarks to warmup before doing the run.Number of warmup iterationsWarmup mode.The duration for warmup iterationsvoid
void
Should force GC between iterations?Should harness terminate on first error encountered?boolean
boolean
boolean
boolean
boolean
Should synchronize iterations?void
showHelp()
private static <T> Optional
<T> toOptional
(joptsimple.OptionSpec<T> option, joptsimple.OptionSet set) treatQuoted
(joptsimple.OptionSet set, joptsimple.OptionSpec<String> spec) How verbose should we be?private String
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
iterations
-
timeout
-
runTime
-
batchSize
-
warmupIterations
-
warmupTime
-
warmupBatchSize
-
benchMode
-
threads
-
threadGroups
-
synchIterations
-
gcEachIteration
-
verbose
-
failOnError
-
profilers
-
timeUnit
-
opsPerInvocation
-
regexps
-
fork
-
warmupFork
-
output
-
result
-
resultFormat
-
jvm
-
jvmArgs
-
jvmArgsAppend
-
jvmArgsPrepend
-
excludes
-
warmupMode
-
warmupMicros
-
params
-
list
private final boolean list -
listWithParams
private final boolean listWithParams -
listResultFormats
private final boolean listResultFormats -
help
private final boolean help -
listProfilers
private final boolean listProfilers -
parser
private final transient joptsimple.OptionParser parser
-
-
Constructor Details
-
CommandLineOptions
Parses the given command line.- Parameters:
argv
- argument list- Throws:
CommandLineOptionException
- if some options are misspelled
-
-
Method Details
-
warmupModesDesc
-
toOptional
private static <T> Optional<T> toOptional(joptsimple.OptionSpec<T> option, joptsimple.OptionSet set) -
treatQuoted
public Optional<Collection<String>> treatQuoted(joptsimple.OptionSet set, joptsimple.OptionSpec<String> spec) -
showHelp
- Throws:
IOException
-
listProfilers
public void listProfilers() -
listResultFormats
public void listResultFormats() -
shouldList
public boolean shouldList() -
shouldListWithParams
public boolean shouldListWithParams() -
shouldListResultFormats
public boolean shouldListResultFormats() -
shouldHelp
public boolean shouldHelp() -
shouldListProfilers
public boolean shouldListProfilers() -
getWarmupMode
Description copied from interface:Options
Warmup mode.- Specified by:
getWarmupMode
in interfaceOptions
- Returns:
- warmup mode
- See Also:
-
getIncludes
Description copied from interface:Options
Which benchmarks to execute?- Specified by:
getIncludes
in interfaceOptions
- Returns:
- list of regexps matching the requested benchmarks
-
getExcludes
Description copied from interface:Options
Which benchmarks to omit?- Specified by:
getExcludes
in interfaceOptions
- Returns:
- list of regexps matching the ignored benchmarks
-
getWarmupIncludes
Description copied from interface:Options
Which benchmarks to warmup before doing the run.- Specified by:
getWarmupIncludes
in interfaceOptions
- Returns:
- list of regexps matching the relevant benchmarks; empty if no benchmarks are defined
-
getJvm
Description copied from interface:Options
JVM executable to use for forks -
getJvmArgs
Description copied from interface:Options
JVM parameters to use with forks- Specified by:
getJvmArgs
in interfaceOptions
- Returns:
- JVM parameters
- See Also:
-
getJvmArgsAppend
Description copied from interface:Options
JVM parameters to use with forks (these options will be appended after any other JVM option)- Specified by:
getJvmArgsAppend
in interfaceOptions
- Returns:
- JVM parameters
- See Also:
-
getJvmArgsPrepend
Description copied from interface:Options
JVM parameters to use with forks (these options will be prepended before any other JVM option)- Specified by:
getJvmArgsPrepend
in interfaceOptions
- Returns:
- JVM parameters
- See Also:
-
getParameter
Description copied from interface:Options
The overridden value of the parameter.- Specified by:
getParameter
in interfaceOptions
- Parameters:
name
- parameter name- Returns:
- parameter
- See Also:
-
getForkCount
Description copied from interface:Options
Fork count- Specified by:
getForkCount
in interfaceOptions
- Returns:
- fork count; 0, to prohibit forking
- See Also:
-
getWarmupForkCount
Description copied from interface:Options
Number of initial forks to ignore the results for- Specified by:
getWarmupForkCount
in interfaceOptions
- Returns:
- initial fork count; 0, to disable
- See Also:
-
getOutput
Description copied from interface:Options
Which file to use for dumping the output -
getResultFormat
Description copied from interface:Options
Result format to use- Specified by:
getResultFormat
in interfaceOptions
- Returns:
- format type
-
getResult
Description copied from interface:Options
Which file to use for dumping the result -
getMeasurementIterations
Description copied from interface:Options
Number of measurement iterations- Specified by:
getMeasurementIterations
in interfaceOptions
- Returns:
- number of measurement iterations
- See Also:
-
getMeasurementBatchSize
Description copied from interface:Options
Number of batch size for measurement- Specified by:
getMeasurementBatchSize
in interfaceOptions
- Returns:
- number of batch size for measurement
- See Also:
-
getMeasurementTime
Description copied from interface:Options
The duration for measurement iterations- Specified by:
getMeasurementTime
in interfaceOptions
- Returns:
- duration
- See Also:
-
getWarmupTime
Description copied from interface:Options
The duration for warmup iterations- Specified by:
getWarmupTime
in interfaceOptions
- Returns:
- duration
- See Also:
-
getWarmupIterations
Description copied from interface:Options
Number of warmup iterations- Specified by:
getWarmupIterations
in interfaceOptions
- Returns:
- number of warmup iterations
- See Also:
-
getWarmupBatchSize
Description copied from interface:Options
Number of batch size for warmup- Specified by:
getWarmupBatchSize
in interfaceOptions
- Returns:
- number of batch size for warmup
- See Also:
-
getThreads
Description copied from interface:Options
Number of threads to run- Specified by:
getThreads
in interfaceOptions
- Returns:
- number of threads; 0 to use maximum number of threads
- See Also:
-
getThreadGroups
Description copied from interface:Options
Thread subgroups distribution.- Specified by:
getThreadGroups
in interfaceOptions
- Returns:
- array of thread ratios
- See Also:
-
shouldDoGC
Description copied from interface:Options
Should force GC between iterations?- Specified by:
shouldDoGC
in interfaceOptions
- Returns:
- should GC?
-
shouldSyncIterations
Description copied from interface:Options
Should synchronize iterations?- Specified by:
shouldSyncIterations
in interfaceOptions
- Returns:
- should we?
-
verbosity
Description copied from interface:Options
How verbose should we be? -
getTimeUnit
Description copied from interface:Options
Timeunit to use in units.- Specified by:
getTimeUnit
in interfaceOptions
- Returns:
- timeunit
- See Also:
-
getOperationsPerInvocation
Description copied from interface:Options
Operations per invocation.- Specified by:
getOperationsPerInvocation
in interfaceOptions
- Returns:
- operations per invocation.
- See Also:
-
shouldFailOnError
Description copied from interface:Options
Should harness terminate on first error encountered?- Specified by:
shouldFailOnError
in interfaceOptions
- Returns:
- should terminate?
-
getProfilers
Description copied from interface:Options
Profilers to use for the run. Profilers will start in the order specified by collection, and will stop in the reverse order.- Specified by:
getProfilers
in interfaceOptions
- Returns:
- profilers to use; empty collection if no profilers are required
-
getBenchModes
Description copied from interface:Options
Benchmarks modes to execute.- Specified by:
getBenchModes
in interfaceOptions
- Returns:
- modes to execute the benchmarks in; empty to use the default modes
- See Also:
-
getTimeout
Description copied from interface:Options
Timeout: how long to wait for an iteration to complete.- Specified by:
getTimeout
in interfaceOptions
- Returns:
- duration
-