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:
  • Constructor Details

  • Method Details

    • 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 interface Options
      Returns:
      warmup mode
      See Also:
    • getIncludes

      public List<String> getIncludes()
      Description copied from interface: Options
      Which benchmarks to execute?
      Specified by:
      getIncludes in interface Options
      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 interface Options
      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 interface Options
      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
      Specified by:
      getJvm in interface Options
      Returns:
      path to JVM executable
    • getJvmArgs

      public Optional<Collection<String>> getJvmArgs()
      Description copied from interface: Options
      JVM parameters to use with forks
      Specified by:
      getJvmArgs in interface Options
      Returns:
      JVM parameters
      See Also:
    • 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 interface Options
      Returns:
      JVM parameters
      See Also:
    • 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 interface Options
      Returns:
      JVM parameters
      See Also:
    • getParameter

      public Optional<Collection<String>> getParameter(String name)
      Description copied from interface: Options
      The overridden value of the parameter.
      Specified by:
      getParameter in interface Options
      Parameters:
      name - parameter name
      Returns:
      parameter
      See Also:
    • getForkCount

      public Optional<Integer> getForkCount()
      Description copied from interface: Options
      Fork count
      Specified by:
      getForkCount in interface Options
      Returns:
      fork count; 0, to prohibit forking
      See Also:
    • getWarmupForkCount

      public Optional<Integer> getWarmupForkCount()
      Description copied from interface: Options
      Number of initial forks to ignore the results for
      Specified by:
      getWarmupForkCount in interface Options
      Returns:
      initial fork count; 0, to disable
      See Also:
    • getOutput

      public Optional<String> getOutput()
      Description copied from interface: Options
      Which file to use for dumping the output
      Specified by:
      getOutput in interface Options
      Returns:
      file name
    • getResultFormat

      public Optional<ResultFormatType> getResultFormat()
      Description copied from interface: Options
      Result format to use
      Specified by:
      getResultFormat in interface Options
      Returns:
      format type
    • getResult

      public Optional<String> getResult()
      Description copied from interface: Options
      Which file to use for dumping the result
      Specified by:
      getResult in interface Options
      Returns:
      file name
    • getMeasurementIterations

      public Optional<Integer> getMeasurementIterations()
      Description copied from interface: Options
      Number of measurement iterations
      Specified by:
      getMeasurementIterations in interface Options
      Returns:
      number of measurement iterations
      See Also:
    • getMeasurementBatchSize

      public Optional<Integer> getMeasurementBatchSize()
      Description copied from interface: Options
      Number of batch size for measurement
      Specified by:
      getMeasurementBatchSize in interface Options
      Returns:
      number of batch size for measurement
      See Also:
    • getMeasurementTime

      public Optional<TimeValue> getMeasurementTime()
      Description copied from interface: Options
      The duration for measurement iterations
      Specified by:
      getMeasurementTime in interface Options
      Returns:
      duration
      See Also:
    • getWarmupTime

      public Optional<TimeValue> getWarmupTime()
      Description copied from interface: Options
      The duration for warmup iterations
      Specified by:
      getWarmupTime in interface Options
      Returns:
      duration
      See Also:
    • getWarmupIterations

      public Optional<Integer> getWarmupIterations()
      Description copied from interface: Options
      Number of warmup iterations
      Specified by:
      getWarmupIterations in interface Options
      Returns:
      number of warmup iterations
      See Also:
    • getWarmupBatchSize

      public Optional<Integer> getWarmupBatchSize()
      Description copied from interface: Options
      Number of batch size for warmup
      Specified by:
      getWarmupBatchSize in interface Options
      Returns:
      number of batch size for warmup
      See Also:
    • getThreads

      public Optional<Integer> getThreads()
      Description copied from interface: Options
      Number of threads to run
      Specified by:
      getThreads in interface Options
      Returns:
      number of threads; 0 to use maximum number of threads
      See Also:
    • getThreadGroups

      public Optional<int[]> getThreadGroups()
      Description copied from interface: Options
      Thread subgroups distribution.
      Specified by:
      getThreadGroups in interface Options
      Returns:
      array of thread ratios
      See Also:
    • shouldDoGC

      public Optional<Boolean> shouldDoGC()
      Description copied from interface: Options
      Should force GC between iterations?
      Specified by:
      shouldDoGC in interface Options
      Returns:
      should GC?
    • shouldSyncIterations

      public Optional<Boolean> shouldSyncIterations()
      Description copied from interface: Options
      Should synchronize iterations?
      Specified by:
      shouldSyncIterations in interface Options
      Returns:
      should we?
    • verbosity

      public Optional<VerboseMode> verbosity()
      Description copied from interface: Options
      How verbose should we be?
      Specified by:
      verbosity in interface Options
      Returns:
      verbosity mode
    • getTimeUnit

      public Optional<TimeUnit> getTimeUnit()
      Description copied from interface: Options
      Timeunit to use in units.
      Specified by:
      getTimeUnit in interface Options
      Returns:
      timeunit
      See Also:
    • getOperationsPerInvocation

      public Optional<Integer> getOperationsPerInvocation()
      Description copied from interface: Options
      Operations per invocation.
      Specified by:
      getOperationsPerInvocation in interface Options
      Returns:
      operations per invocation.
      See Also:
    • shouldFailOnError

      public Optional<Boolean> shouldFailOnError()
      Description copied from interface: Options
      Should harness terminate on first error encountered?
      Specified by:
      shouldFailOnError in interface Options
      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 interface Options
      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 interface Options
      Returns:
      modes to execute the benchmarks in; empty to use the default modes
      See Also:
    • getTimeout

      public Optional<TimeValue> getTimeout()
      Description copied from interface: Options
      Timeout: how long to wait for an iteration to complete.
      Specified by:
      getTimeout in interface Options
      Returns:
      duration