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 iterationsvoidlistProfilers()voidlistResultFormats()Optional<Boolean>shouldDoGC()Should force GC between iterations?Optional<Boolean>shouldFailOnError()Should harness terminate on first error encountered?booleanshouldHelp()booleanshouldList()booleanshouldListProfilers()booleanshouldListResultFormats()booleanshouldListWithParams()Optional<Boolean>shouldSyncIterations()Should synchronize iterations?voidshowHelp()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:OptionsWarmup mode.- Specified by:
getWarmupModein interfaceOptions- Returns:
- warmup mode
- See Also:
WarmupMode
-
getIncludes
public List<String> getIncludes()
Description copied from interface:OptionsWhich benchmarks to execute?- Specified by:
getIncludesin interfaceOptions- Returns:
- list of regexps matching the requested benchmarks
-
getExcludes
public List<String> getExcludes()
Description copied from interface:OptionsWhich benchmarks to omit?- Specified by:
getExcludesin interfaceOptions- Returns:
- list of regexps matching the ignored benchmarks
-
getWarmupIncludes
public List<String> getWarmupIncludes()
Description copied from interface:OptionsWhich benchmarks to warmup before doing the run.- Specified by:
getWarmupIncludesin interfaceOptions- Returns:
- list of regexps matching the relevant benchmarks; empty if no benchmarks are defined
-
getJvm
public Optional<String> getJvm()
Description copied from interface:OptionsJVM executable to use for forks
-
getJvmArgs
public Optional<Collection<String>> getJvmArgs()
Description copied from interface:OptionsJVM parameters to use with forks- Specified by:
getJvmArgsin interfaceOptions- Returns:
- JVM parameters
- See Also:
Fork
-
getJvmArgsAppend
public Optional<Collection<String>> getJvmArgsAppend()
Description copied from interface:OptionsJVM parameters to use with forks (these options will be appended after any other JVM option)- Specified by:
getJvmArgsAppendin interfaceOptions- Returns:
- JVM parameters
- See Also:
Fork
-
getJvmArgsPrepend
public Optional<Collection<String>> getJvmArgsPrepend()
Description copied from interface:OptionsJVM parameters to use with forks (these options will be prepended before any other JVM option)- Specified by:
getJvmArgsPrependin interfaceOptions- Returns:
- JVM parameters
- See Also:
Fork
-
getParameter
public Optional<Collection<String>> getParameter(String name)
Description copied from interface:OptionsThe overridden value of the parameter.- Specified by:
getParameterin interfaceOptions- Parameters:
name- parameter name- Returns:
- parameter
- See Also:
Param
-
getForkCount
public Optional<Integer> getForkCount()
Description copied from interface:OptionsFork count- Specified by:
getForkCountin interfaceOptions- Returns:
- fork count; 0, to prohibit forking
- See Also:
Fork
-
getWarmupForkCount
public Optional<Integer> getWarmupForkCount()
Description copied from interface:OptionsNumber of initial forks to ignore the results for- Specified by:
getWarmupForkCountin interfaceOptions- Returns:
- initial fork count; 0, to disable
- See Also:
Fork
-
getOutput
public Optional<String> getOutput()
Description copied from interface:OptionsWhich file to use for dumping the output
-
getResultFormat
public Optional<ResultFormatType> getResultFormat()
Description copied from interface:OptionsResult format to use- Specified by:
getResultFormatin interfaceOptions- Returns:
- format type
-
getResult
public Optional<String> getResult()
Description copied from interface:OptionsWhich file to use for dumping the result
-
getMeasurementIterations
public Optional<Integer> getMeasurementIterations()
Description copied from interface:OptionsNumber of measurement iterations- Specified by:
getMeasurementIterationsin interfaceOptions- Returns:
- number of measurement iterations
- See Also:
Measurement
-
getMeasurementBatchSize
public Optional<Integer> getMeasurementBatchSize()
Description copied from interface:OptionsNumber of batch size for measurement- Specified by:
getMeasurementBatchSizein interfaceOptions- Returns:
- number of batch size for measurement
- See Also:
Measurement
-
getMeasurementTime
public Optional<TimeValue> getMeasurementTime()
Description copied from interface:OptionsThe duration for measurement iterations- Specified by:
getMeasurementTimein interfaceOptions- Returns:
- duration
- See Also:
Measurement
-
getWarmupTime
public Optional<TimeValue> getWarmupTime()
Description copied from interface:OptionsThe duration for warmup iterations- Specified by:
getWarmupTimein interfaceOptions- Returns:
- duration
- See Also:
Warmup
-
getWarmupIterations
public Optional<Integer> getWarmupIterations()
Description copied from interface:OptionsNumber of warmup iterations- Specified by:
getWarmupIterationsin interfaceOptions- Returns:
- number of warmup iterations
- See Also:
Warmup
-
getWarmupBatchSize
public Optional<Integer> getWarmupBatchSize()
Description copied from interface:OptionsNumber of batch size for warmup- Specified by:
getWarmupBatchSizein interfaceOptions- Returns:
- number of batch size for warmup
- See Also:
Warmup
-
getThreads
public Optional<Integer> getThreads()
Description copied from interface:OptionsNumber of threads to run- Specified by:
getThreadsin interfaceOptions- Returns:
- number of threads; 0 to use maximum number of threads
- See Also:
Threads
-
getThreadGroups
public Optional<int[]> getThreadGroups()
Description copied from interface:OptionsThread subgroups distribution.- Specified by:
getThreadGroupsin interfaceOptions- Returns:
- array of thread ratios
- See Also:
Group,GroupThreads
-
shouldDoGC
public Optional<Boolean> shouldDoGC()
Description copied from interface:OptionsShould force GC between iterations?- Specified by:
shouldDoGCin interfaceOptions- Returns:
- should GC?
-
shouldSyncIterations
public Optional<Boolean> shouldSyncIterations()
Description copied from interface:OptionsShould synchronize iterations?- Specified by:
shouldSyncIterationsin interfaceOptions- Returns:
- should we?
-
verbosity
public Optional<VerboseMode> verbosity()
Description copied from interface:OptionsHow verbose should we be?
-
getTimeUnit
public Optional<TimeUnit> getTimeUnit()
Description copied from interface:OptionsTimeunit to use in units.- Specified by:
getTimeUnitin interfaceOptions- Returns:
- timeunit
- See Also:
OutputTimeUnit
-
getOperationsPerInvocation
public Optional<Integer> getOperationsPerInvocation()
Description copied from interface:OptionsOperations per invocation.- Specified by:
getOperationsPerInvocationin interfaceOptions- Returns:
- operations per invocation.
- See Also:
OperationsPerInvocation
-
shouldFailOnError
public Optional<Boolean> shouldFailOnError()
Description copied from interface:OptionsShould harness terminate on first error encountered?- Specified by:
shouldFailOnErrorin interfaceOptions- Returns:
- should terminate?
-
getProfilers
public List<ProfilerConfig> getProfilers()
Description copied from interface:OptionsProfilers to use for the run. Profilers will start in the order specified by collection, and will stop in the reverse order.- Specified by:
getProfilersin interfaceOptions- Returns:
- profilers to use; empty collection if no profilers are required
-
getBenchModes
public Collection<Mode> getBenchModes()
Description copied from interface:OptionsBenchmarks modes to execute.- Specified by:
getBenchModesin 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:OptionsTimeout: how long to wait for an iteration to complete.- Specified by:
getTimeoutin interfaceOptions- Returns:
- duration
-
-