Class CommandLineOptions

  • All Implemented Interfaces:
    java.io.Serializable, Options

    public class CommandLineOptions
    extends java.lang.Object
    implements Options
    Class that handles all the command line options.
    See Also:
    Serialized Form
    • Field Detail

      • iterations

        private final Optional<java.lang.Integer> iterations
      • batchSize

        private final Optional<java.lang.Integer> batchSize
      • warmupIterations

        private final Optional<java.lang.Integer> warmupIterations
      • warmupBatchSize

        private final Optional<java.lang.Integer> warmupBatchSize
      • benchMode

        private final java.util.List<Mode> benchMode
      • threads

        private final Optional<java.lang.Integer> threads
      • threadGroups

        private final java.util.List<java.lang.Integer> threadGroups
      • synchIterations

        private final Optional<java.lang.Boolean> synchIterations
      • gcEachIteration

        private final Optional<java.lang.Boolean> gcEachIteration
      • failOnError

        private final Optional<java.lang.Boolean> failOnError
      • timeUnit

        private final Optional<java.util.concurrent.TimeUnit> timeUnit
      • opsPerInvocation

        private final Optional<java.lang.Integer> opsPerInvocation
      • regexps

        private final java.util.List<java.lang.String> regexps
      • fork

        private final Optional<java.lang.Integer> fork
      • warmupFork

        private final Optional<java.lang.Integer> warmupFork
      • output

        private final Optional<java.lang.String> output
      • result

        private final Optional<java.lang.String> result
      • jvm

        private final Optional<java.lang.String> jvm
      • jvmArgs

        private final Optional<java.util.Collection<java.lang.String>> jvmArgs
      • jvmArgsAppend

        private final Optional<java.util.Collection<java.lang.String>> jvmArgsAppend
      • jvmArgsPrepend

        private final Optional<java.util.Collection<java.lang.String>> jvmArgsPrepend
      • excludes

        private final java.util.List<java.lang.String> excludes
      • warmupMicros

        private final java.util.List<java.lang.String> warmupMicros
      • params

        private final Multimap<java.lang.String,​java.lang.String> 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
    • Method Detail

      • warmupModesDesc

        private java.lang.String warmupModesDesc()
      • toOptional

        private static <T> Optional<T> toOptional​(joptsimple.OptionSpec<T> option,
                                                  joptsimple.OptionSet set)
      • treatQuoted

        public Optional<java.util.Collection<java.lang.String>> treatQuoted​(joptsimple.OptionSet set,
                                                                            joptsimple.OptionSpec<java.lang.String> spec)
      • showHelp

        public void showHelp()
                      throws java.io.IOException
        Throws:
        java.io.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()
      • getIncludes

        public java.util.List<java.lang.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 java.util.List<java.lang.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 java.util.List<java.lang.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<java.lang.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<java.util.Collection<java.lang.String>> getJvmArgs()
        Description copied from interface: Options
        JVM parameters to use with forks
        Specified by:
        getJvmArgs in interface Options
        Returns:
        JVM parameters
        See Also:
        Fork
      • getJvmArgsAppend

        public Optional<java.util.Collection<java.lang.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:
        Fork
      • getJvmArgsPrepend

        public Optional<java.util.Collection<java.lang.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:
        Fork
      • getParameter

        public Optional<java.util.Collection<java.lang.String>> getParameter​(java.lang.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:
        Param
      • getForkCount

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

        public Optional<java.lang.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:
        Fork
      • getOutput

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

        public Optional<java.lang.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<java.lang.Integer> getMeasurementIterations()
        Description copied from interface: Options
        Number of measurement iterations
        Specified by:
        getMeasurementIterations in interface Options
        Returns:
        number of measurement iterations
        See Also:
        Measurement
      • getMeasurementBatchSize

        public Optional<java.lang.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:
        Measurement
      • getWarmupIterations

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

        public Optional<java.lang.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:
        Warmup
      • getThreads

        public Optional<java.lang.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:
        Threads
      • shouldDoGC

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

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

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

        public Optional<java.lang.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 java.util.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 java.util.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:
        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 interface Options
        Returns:
        duration