Package org.openjdk.jmh.runner.options
Class CommandLineOptions
- java.lang.Object
-
- org.openjdk.jmh.runner.options.CommandLineOptions
-
- All Implemented Interfaces:
Serializable
,Options
public class CommandLineOptions extends Object implements Options
Class that handles all the command line options.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CommandLineOptions(String... argv)
Parses the given command line.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Mode>
getBenchModes()
Benchmarks modes to execute.List<String>
getExcludes()
Which benchmarks to omit?Optional<Integer>
getForkCount()
Fork countList<String>
getIncludes()
Which benchmarks to execute?Optional<String>
getJvm()
JVM executable to use for forksOptional<Collection<String>>
getJvmArgs()
JVM parameters to use with forksOptional<Collection<String>>
getJvmArgsAppend()
JVM parameters to use with forks (these options will be appended after any other JVM option)Optional<Collection<String>>
getJvmArgsPrepend()
JVM parameters to use with forks (these options will be prepended before any other JVM option)Optional<Integer>
getMeasurementBatchSize()
Number of batch size for measurementOptional<Integer>
getMeasurementIterations()
Number of measurement iterationsOptional<TimeValue>
getMeasurementTime()
The duration for measurement iterationsOptional<Integer>
getOperationsPerInvocation()
Operations per invocation.Optional<String>
getOutput()
Which file to use for dumping the outputOptional<Collection<String>>
getParameter(String name)
The overridden value of the parameter.List<ProfilerConfig>
getProfilers()
Profilers to use for the run.Optional<String>
getResult()
Which file to use for dumping the resultOptional<ResultFormatType>
getResultFormat()
Result format to useOptional<int[]>
getThreadGroups()
Thread subgroups distribution.Optional<Integer>
getThreads()
Number of threads to runOptional<TimeValue>
getTimeout()
Timeout: how long to wait for an iteration to complete.Optional<TimeUnit>
getTimeUnit()
Timeunit to use in units.Optional<Integer>
getWarmupBatchSize()
Number of batch size for warmupOptional<Integer>
getWarmupForkCount()
Number of initial forks to ignore the results forList<String>
getWarmupIncludes()
Which benchmarks to warmup before doing the run.Optional<Integer>
getWarmupIterations()
Number of warmup iterationsOptional<WarmupMode>
getWarmupMode()
Warmup mode.Optional<TimeValue>
getWarmupTime()
The duration for warmup iterationsvoid
listProfilers()
void
listResultFormats()
Optional<Boolean>
shouldDoGC()
Should force GC between iterations?Optional<Boolean>
shouldFailOnError()
Should harness terminate on first error encountered?boolean
shouldHelp()
boolean
shouldList()
boolean
shouldListProfilers()
boolean
shouldListResultFormats()
boolean
shouldListWithParams()
Optional<Boolean>
shouldSyncIterations()
Should synchronize iterations?void
showHelp()
Optional<Collection<String>>
treatQuoted(joptsimple.OptionSet set, joptsimple.OptionSpec<String> spec)
Optional<VerboseMode>
verbosity()
How verbose should we be?
-
-
-
Constructor Detail
-
CommandLineOptions
public CommandLineOptions(String... argv) throws CommandLineOptionException
Parses the given command line.- Parameters:
argv
- argument list- Throws:
CommandLineOptionException
- if some options are misspelled
-
-
Method Detail
-
treatQuoted
public Optional<Collection<String>> treatQuoted(joptsimple.OptionSet set, joptsimple.OptionSpec<String> spec)
-
showHelp
public void showHelp() throws IOException
- 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
public Optional<WarmupMode> getWarmupMode()
Description copied from interface:Options
Warmup mode.- Specified by:
getWarmupMode
in interfaceOptions
- Returns:
- warmup mode
- See Also:
WarmupMode
-
getIncludes
public List<String> getIncludes()
Description copied from interface:Options
Which benchmarks to execute?- Specified by:
getIncludes
in interfaceOptions
- Returns:
- list of regexps matching the requested benchmarks
-
getExcludes
public List<String> getExcludes()
Description copied from interface:Options
Which benchmarks to omit?- Specified by:
getExcludes
in interfaceOptions
- Returns:
- list of regexps matching the ignored benchmarks
-
getWarmupIncludes
public List<String> 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
public Optional<String> getJvm()
Description copied from interface:Options
JVM executable to use for forks
-
getJvmArgs
public Optional<Collection<String>> getJvmArgs()
Description copied from interface:Options
JVM parameters to use with forks- Specified by:
getJvmArgs
in interfaceOptions
- Returns:
- JVM parameters
- See Also:
Fork
-
getJvmArgsAppend
public Optional<Collection<String>> 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:
Fork
-
getJvmArgsPrepend
public Optional<Collection<String>> 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:
Fork
-
getParameter
public Optional<Collection<String>> getParameter(String name)
Description copied from interface:Options
The overridden value of the parameter.- Specified by:
getParameter
in interfaceOptions
- Parameters:
name
- parameter name- Returns:
- parameter
- See Also:
Param
-
getForkCount
public Optional<Integer> getForkCount()
Description copied from interface:Options
Fork count- Specified by:
getForkCount
in interfaceOptions
- Returns:
- fork count; 0, to prohibit forking
- See Also:
Fork
-
getWarmupForkCount
public Optional<Integer> 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:
Fork
-
getOutput
public Optional<String> getOutput()
Description copied from interface:Options
Which file to use for dumping the output
-
getResultFormat
public Optional<ResultFormatType> getResultFormat()
Description copied from interface:Options
Result format to use- Specified by:
getResultFormat
in interfaceOptions
- Returns:
- format type
-
getResult
public Optional<String> getResult()
Description copied from interface:Options
Which file to use for dumping the result
-
getMeasurementIterations
public Optional<Integer> getMeasurementIterations()
Description copied from interface:Options
Number of measurement iterations- Specified by:
getMeasurementIterations
in interfaceOptions
- Returns:
- number of measurement iterations
- See Also:
Measurement
-
getMeasurementBatchSize
public Optional<Integer> 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:
Measurement
-
getMeasurementTime
public Optional<TimeValue> getMeasurementTime()
Description copied from interface:Options
The duration for measurement iterations- Specified by:
getMeasurementTime
in interfaceOptions
- Returns:
- duration
- See Also:
Measurement
-
getWarmupTime
public Optional<TimeValue> getWarmupTime()
Description copied from interface:Options
The duration for warmup iterations- Specified by:
getWarmupTime
in interfaceOptions
- Returns:
- duration
- See Also:
Warmup
-
getWarmupIterations
public Optional<Integer> getWarmupIterations()
Description copied from interface:Options
Number of warmup iterations- Specified by:
getWarmupIterations
in interfaceOptions
- Returns:
- number of warmup iterations
- See Also:
Warmup
-
getWarmupBatchSize
public Optional<Integer> 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:
Warmup
-
getThreads
public Optional<Integer> 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:
Threads
-
getThreadGroups
public Optional<int[]> getThreadGroups()
Description copied from interface:Options
Thread subgroups distribution.- Specified by:
getThreadGroups
in interfaceOptions
- Returns:
- array of thread ratios
- See Also:
Group
,GroupThreads
-
shouldDoGC
public Optional<Boolean> shouldDoGC()
Description copied from interface:Options
Should force GC between iterations?- Specified by:
shouldDoGC
in interfaceOptions
- Returns:
- should GC?
-
shouldSyncIterations
public Optional<Boolean> shouldSyncIterations()
Description copied from interface:Options
Should synchronize iterations?- Specified by:
shouldSyncIterations
in interfaceOptions
- Returns:
- should we?
-
verbosity
public Optional<VerboseMode> verbosity()
Description copied from interface:Options
How verbose should we be?
-
getTimeUnit
public Optional<TimeUnit> getTimeUnit()
Description copied from interface:Options
Timeunit to use in units.- Specified by:
getTimeUnit
in interfaceOptions
- Returns:
- timeunit
- See Also:
OutputTimeUnit
-
getOperationsPerInvocation
public Optional<Integer> getOperationsPerInvocation()
Description copied from interface:Options
Operations per invocation.- Specified by:
getOperationsPerInvocation
in interfaceOptions
- Returns:
- operations per invocation.
- See Also:
OperationsPerInvocation
-
shouldFailOnError
public Optional<Boolean> shouldFailOnError()
Description copied from interface:Options
Should harness terminate on first error encountered?- Specified by:
shouldFailOnError
in interfaceOptions
- Returns:
- should terminate?
-
getProfilers
public List<ProfilerConfig> 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
public Collection<Mode> 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:
BenchmarkMode
-
getTimeout
public Optional<TimeValue> getTimeout()
Description copied from interface:Options
Timeout: how long to wait for an iteration to complete.- Specified by:
getTimeout
in interfaceOptions
- Returns:
- duration
-
-