Package org.openjdk.jmh.runner.options
Class OptionsBuilder
java.lang.Object
org.openjdk.jmh.runner.options.OptionsBuilder
- All Implemented Interfaces:
Serializable,ChainedOptionsBuilder,Options
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddProfiler(Class<? extends Profiler> prof) Add the profiler in the runaddProfiler(Class<? extends Profiler> prof, String initLine) Add the profiler in the runaddProfiler(String prof) Add the profiler in the runaddProfiler(String prof, String initLine) Add the profiler in the runbuild()Produce the final OptionsAutodetect forked JVM arguments from the parent VM.Exclude benchmarks from the run (Can be used multiple times)forks(int value) Number of forks to use in the runBenchmarks 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 iterationsInclude benchmark in the run (Can be used multiple times)includeWarmup(String regexp) What other benchmarks to warmup along the wayForked JVM to use.Forked JVM arguments.jvmArgsAppend(String... value) Append forked JVM arguments: These options go after other options.jvmArgsPrepend(String... value) Prepend forked JVM arguments: These options go before any other options.measurementBatchSize(int value) How large measurement batchSize should be?measurementIterations(int count) How many measurement measurementIterations to domeasurementTime(TimeValue value) How long each measurement iteration should take?Benchmark mode.operationsPerInvocation(int opsPerInv) Operations per invocation.Output filename to write the run log toSet benchmark parameter values.Override the defaults from the given option.Output filename to write the result toresultFormat(ResultFormatType type) ResultFormatType to use in the runShould force GC between iterations?shouldDoGC(boolean value) Should do GC between measurementIterations?Should harness terminate on first error encountered?shouldFailOnError(boolean value) Should fail on first benchmark error?Should synchronize iterations?syncIterations(boolean value) Should synchronize measurementIterations?threadGroups(int... groups) Subgroups thread distribution.threads(int count) Number of threads to run the benchmark inHow long to wait for iteration execution?Timeunit to use in resultsHow verbose should we be?verbosity(VerboseMode mode) Control verbosity level.warmupBatchSize(int value) How large warmup batchSize should be?warmupForks(int value) Number of ignored forkswarmupIterations(int value) How many warmup iterations to do?warmupMode(WarmupMode mode) Warmup mode to usewarmupTime(TimeValue value) How long each warmup iteration should take?
-
Constructor Details
-
OptionsBuilder
public OptionsBuilder()
-
-
Method Details
-
build
Description copied from interface:ChainedOptionsBuilderProduce the final Options- Specified by:
buildin interfaceChainedOptionsBuilder- Returns:
- options object.
-
parent
Description copied from interface:ChainedOptionsBuilderOverride the defaults from the given option. You may use this only once.- Specified by:
parentin interfaceChainedOptionsBuilder- Parameters:
other- options to base on- Returns:
- builder
-
include
Description copied from interface:ChainedOptionsBuilderInclude benchmark in the run (Can be used multiple times)- Specified by:
includein interfaceChainedOptionsBuilder- Parameters:
regexp- to match benchmarks against- Returns:
- builder
- See Also:
-
getIncludes
Description copied from interface:OptionsWhich benchmarks to execute?- Specified by:
getIncludesin interfaceOptions- Returns:
- list of regexps matching the requested benchmarks
-
exclude
Description copied from interface:ChainedOptionsBuilderExclude benchmarks from the run (Can be used multiple times)- Specified by:
excludein interfaceChainedOptionsBuilder- Parameters:
regexp- to match benchmark against- Returns:
- builder
-
getExcludes
Description copied from interface:OptionsWhich benchmarks to omit?- Specified by:
getExcludesin interfaceOptions- Returns:
- list of regexps matching the ignored benchmarks
-
output
Description copied from interface:ChainedOptionsBuilderOutput filename to write the run log to- Specified by:
outputin interfaceChainedOptionsBuilder- Parameters:
filename- file name- Returns:
- builder
-
getOutput
Description copied from interface:OptionsWhich file to use for dumping the output -
resultFormat
Description copied from interface:ChainedOptionsBuilderResultFormatType to use in the run- Specified by:
resultFormatin interfaceChainedOptionsBuilder- Parameters:
type- resultformat type- Returns:
- builder
- See Also:
-
getResultFormat
Description copied from interface:OptionsResult format to use- Specified by:
getResultFormatin interfaceOptions- Returns:
- format type
-
result
Description copied from interface:ChainedOptionsBuilderOutput filename to write the result to- Specified by:
resultin interfaceChainedOptionsBuilder- Parameters:
filename- file name- Returns:
- builder
- See Also:
-
getResult
Description copied from interface:OptionsWhich file to use for dumping the result -
shouldDoGC
Description copied from interface:ChainedOptionsBuilderShould do GC between measurementIterations?- Specified by:
shouldDoGCin interfaceChainedOptionsBuilder- Parameters:
value- flag- Returns:
- builder
- See Also:
-
shouldDoGC
Description copied from interface:OptionsShould force GC between iterations?- Specified by:
shouldDoGCin interfaceOptions- Returns:
- should GC?
-
addProfiler
Description copied from interface:ChainedOptionsBuilderAdd the profiler in the run- Specified by:
addProfilerin interfaceChainedOptionsBuilder- Parameters:
prof- profiler class- Returns:
- builder
-
addProfiler
Description copied from interface:ChainedOptionsBuilderAdd the profiler in the run- Specified by:
addProfilerin interfaceChainedOptionsBuilder- Parameters:
prof- profiler classinitLine- profiler options initialization line- Returns:
- builder
-
addProfiler
Description copied from interface:ChainedOptionsBuilderAdd the profiler in the run- Specified by:
addProfilerin interfaceChainedOptionsBuilder- Parameters:
prof- profiler class name, or profiler alias- Returns:
- builder
-
addProfiler
Description copied from interface:ChainedOptionsBuilderAdd the profiler in the run- Specified by:
addProfilerin interfaceChainedOptionsBuilder- Parameters:
prof- profiler class name, or profiler aliasinitLine- profiler options initialization line- Returns:
- builder
-
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
-
verbosity
Description copied from interface:ChainedOptionsBuilderControl verbosity level.- Specified by:
verbosityin interfaceChainedOptionsBuilder- Parameters:
mode- flag- Returns:
- builder
- See Also:
-
verbosity
Description copied from interface:OptionsHow verbose should we be? -
shouldFailOnError
Description copied from interface:ChainedOptionsBuilderShould fail on first benchmark error?- Specified by:
shouldFailOnErrorin interfaceChainedOptionsBuilder- Parameters:
value- flag- Returns:
- builder
- See Also:
-
shouldFailOnError
Description copied from interface:OptionsShould harness terminate on first error encountered?- Specified by:
shouldFailOnErrorin interfaceOptions- Returns:
- should terminate?
-
threads
Description copied from interface:ChainedOptionsBuilderNumber of threads to run the benchmark in- Specified by:
threadsin interfaceChainedOptionsBuilder- Parameters:
count- number of threads- Returns:
- builder
- See Also:
-
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:
-
threadGroups
Description copied from interface:ChainedOptionsBuilderSubgroups thread distribution.- Specified by:
threadGroupsin interfaceChainedOptionsBuilder- Parameters:
groups- thread distribution- Returns:
- builder
- See Also:
-
getThreadGroups
Description copied from interface:OptionsThread subgroups distribution.- Specified by:
getThreadGroupsin interfaceOptions- Returns:
- array of thread ratios
- See Also:
-
syncIterations
Description copied from interface:ChainedOptionsBuilderShould synchronize measurementIterations?- Specified by:
syncIterationsin interfaceChainedOptionsBuilder- Parameters:
value- flag- Returns:
- builder
- See Also:
-
shouldSyncIterations
Description copied from interface:OptionsShould synchronize iterations?- Specified by:
shouldSyncIterationsin interfaceOptions- Returns:
- should we?
-
warmupIterations
Description copied from interface:ChainedOptionsBuilderHow many warmup iterations to do?- Specified by:
warmupIterationsin interfaceChainedOptionsBuilder- Parameters:
value- flag- Returns:
- builder
- See Also:
-
getWarmupIterations
Description copied from interface:OptionsNumber of warmup iterations- Specified by:
getWarmupIterationsin interfaceOptions- Returns:
- number of warmup iterations
- See Also:
-
warmupBatchSize
Description copied from interface:ChainedOptionsBuilderHow large warmup batchSize should be?- Specified by:
warmupBatchSizein interfaceChainedOptionsBuilder- Parameters:
value- batch size- Returns:
- builder
- See Also:
-
getWarmupBatchSize
Description copied from interface:OptionsNumber of batch size for warmup- Specified by:
getWarmupBatchSizein interfaceOptions- Returns:
- number of batch size for warmup
- See Also:
-
warmupTime
Description copied from interface:ChainedOptionsBuilderHow long each warmup iteration should take?- Specified by:
warmupTimein interfaceChainedOptionsBuilder- Parameters:
value- time- Returns:
- builder
- See Also:
-
getWarmupTime
Description copied from interface:OptionsThe duration for warmup iterations- Specified by:
getWarmupTimein interfaceOptions- Returns:
- duration
- See Also:
-
warmupMode
Description copied from interface:ChainedOptionsBuilderWarmup mode to use- Specified by:
warmupModein interfaceChainedOptionsBuilder- Parameters:
mode- to use- Returns:
- builder
- See Also:
-
getWarmupMode
Description copied from interface:OptionsWarmup mode.- Specified by:
getWarmupModein interfaceOptions- Returns:
- warmup mode
- See Also:
-
includeWarmup
Description copied from interface:ChainedOptionsBuilderWhat other benchmarks to warmup along the way- Specified by:
includeWarmupin interfaceChainedOptionsBuilder- Parameters:
regexp- to match benchmarks against- Returns:
- builder
-
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
-
measurementIterations
Description copied from interface:ChainedOptionsBuilderHow many measurement measurementIterations to do- Specified by:
measurementIterationsin interfaceChainedOptionsBuilder- Parameters:
count- number of iterations- Returns:
- builder
- See Also:
-
getMeasurementIterations
Description copied from interface:OptionsNumber of measurement iterations- Specified by:
getMeasurementIterationsin interfaceOptions- Returns:
- number of measurement iterations
- See Also:
-
measurementTime
Description copied from interface:ChainedOptionsBuilderHow long each measurement iteration should take?- Specified by:
measurementTimein interfaceChainedOptionsBuilder- Parameters:
value- time- Returns:
- builder
- See Also:
-
getMeasurementTime
Description copied from interface:OptionsThe duration for measurement iterations- Specified by:
getMeasurementTimein interfaceOptions- Returns:
- duration
- See Also:
-
measurementBatchSize
Description copied from interface:ChainedOptionsBuilderHow large measurement batchSize should be?- Specified by:
measurementBatchSizein interfaceChainedOptionsBuilder- Parameters:
value- batch size- Returns:
- builder
- See Also:
-
getMeasurementBatchSize
Description copied from interface:OptionsNumber of batch size for measurement- Specified by:
getMeasurementBatchSizein interfaceOptions- Returns:
- number of batch size for measurement
- See Also:
-
mode
Description copied from interface:ChainedOptionsBuilderBenchmark mode. (Can be used multiple times)- Specified by:
modein interfaceChainedOptionsBuilder- Parameters:
mode- benchmark mode- Returns:
- builder
- See Also:
-
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:
-
timeUnit
Description copied from interface:ChainedOptionsBuilderTimeunit to use in results- Specified by:
timeUnitin interfaceChainedOptionsBuilder- Parameters:
tu- time unit- Returns:
- builder
- See Also:
-
getTimeUnit
Description copied from interface:OptionsTimeunit to use in units.- Specified by:
getTimeUnitin interfaceOptions- Returns:
- timeunit
- See Also:
-
operationsPerInvocation
Description copied from interface:ChainedOptionsBuilderOperations per invocation.- Specified by:
operationsPerInvocationin interfaceChainedOptionsBuilder- Parameters:
opsPerInv- operations per invocation.- Returns:
- builder
- See Also:
-
getOperationsPerInvocation
Description copied from interface:OptionsOperations per invocation.- Specified by:
getOperationsPerInvocationin interfaceOptions- Returns:
- operations per invocation.
- See Also:
-
forks
Description copied from interface:ChainedOptionsBuilderNumber of forks to use in the run- Specified by:
forksin interfaceChainedOptionsBuilder- Parameters:
value- number of forks- Returns:
- builder
- See Also:
-
getForkCount
Description copied from interface:OptionsFork count- Specified by:
getForkCountin interfaceOptions- Returns:
- fork count; 0, to prohibit forking
- See Also:
-
warmupForks
Description copied from interface:ChainedOptionsBuilderNumber of ignored forks- Specified by:
warmupForksin interfaceChainedOptionsBuilder- Parameters:
value- number of ignored forks- Returns:
- builder
- See Also:
-
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:
-
jvm
Description copied from interface:ChainedOptionsBuilderForked JVM to use.- Specified by:
jvmin interfaceChainedOptionsBuilder- Parameters:
path- path to /bin/java- Returns:
- builder
-
getJvm
Description copied from interface:OptionsJVM executable to use for forks -
jvmArgs
Description copied from interface:ChainedOptionsBuilderForked JVM arguments.- Specified by:
jvmArgsin interfaceChainedOptionsBuilder- Parameters:
value- arguments to add to the run- Returns:
- builder
- See Also:
-
getJvmArgs
Description copied from interface:OptionsJVM parameters to use with forks- Specified by:
getJvmArgsin interfaceOptions- Returns:
- JVM parameters
- See Also:
-
jvmArgsAppend
Description copied from interface:ChainedOptionsBuilderAppend forked JVM arguments: These options go after other options.- Specified by:
jvmArgsAppendin interfaceChainedOptionsBuilder- Parameters:
value- arguments to add to the run- Returns:
- builder
- See Also:
-
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:
-
jvmArgsPrepend
Description copied from interface:ChainedOptionsBuilderPrepend forked JVM arguments: These options go before any other options.- Specified by:
jvmArgsPrependin interfaceChainedOptionsBuilder- Parameters:
value- arguments to add to the run- Returns:
- builder
- See Also:
-
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:
-
detectJvmArgs
Description copied from interface:ChainedOptionsBuilderAutodetect forked JVM arguments from the parent VM. Overrides the jvmArgs(...) value.- Specified by:
detectJvmArgsin interfaceChainedOptionsBuilder- Returns:
- builder
-
getParameter
Description copied from interface:OptionsThe overridden value of the parameter.- Specified by:
getParameterin interfaceOptions- Parameters:
name- parameter name- Returns:
- parameter
- See Also:
-
param
Description copied from interface:ChainedOptionsBuilderSet benchmark parameter values. The parameter values would be taken in the order given by user.- Specified by:
paramin interfaceChainedOptionsBuilder- Parameters:
name- parametervalues- sequence of values to set- Returns:
- builder
- See Also:
-
timeout
Description copied from interface:ChainedOptionsBuilderHow long to wait for iteration execution?- Specified by:
timeoutin interfaceChainedOptionsBuilder- Parameters:
value- time- Returns:
- builder
- See Also:
-
getTimeout
Description copied from interface:OptionsTimeout: how long to wait for an iteration to complete.- Specified by:
getTimeoutin interfaceOptions- Returns:
- duration
-