public class SamplingOperationMixRunner extends AbstractOperationMixRunner
The sample is configurable and may be larger/smaller than the size of the mixes to be run, optionally the sample may include repeats of operations.
In the case where random order is disabled and the sample size is smaller
than the mix size only the first N
operations (where N
is the
sample size) will be run and the remaining operations will never be run.
In the case where the desired sample size is larger than the mix size but repeats are not allowed then the actual sample size will be the same as the mix size and every operation will be run precisely once.
Constructor and Description |
---|
SamplingOperationMixRunner(boolean allowRepeats)
Creates a runner which optionally allows repeats, the sample size will
always be the mix size
|
SamplingOperationMixRunner(int sampleSize)
Creates a runner with the given sample size
|
SamplingOperationMixRunner(int sampleSize,
boolean allowRepeats)
Creates a runner with the given sample size that optionally allows
repeats
|
Modifier and Type | Method and Description |
---|---|
protected List<Integer> |
getInOrderSample(OperationMix mix) |
protected <T extends Options> |
getOperationOrder(T options,
OperationMix mix)
Gets the order in which the runner should run the operations
|
protected List<Integer> |
getRandomSample(OperationMix mix) |
reportOperationOrder, run, runOp
public SamplingOperationMixRunner(int sampleSize)
sampleSize
- Sample size, if <= 0 then sample size will always be the mix
sizepublic SamplingOperationMixRunner(boolean allowRepeats)
allowRepeats
- Whether to allow repeatspublic SamplingOperationMixRunner(int sampleSize, boolean allowRepeats)
sampleSize
- Sample size, if <= 0 then sample size will always be the mix
sizeallowRepeats
- WHether to allow repeatsprotected <T extends Options> List<Integer> getOperationOrder(T options, OperationMix mix)
AbstractOperationMixRunner
getOperationOrder
in class AbstractOperationMixRunner
options
- Optionsmix
- Mix containing the operations to be runprotected List<Integer> getRandomSample(OperationMix mix)
protected List<Integer> getInOrderSample(OperationMix mix)
Copyright © 2015. All rights reserved.