public class FlatSequenceMix extends Mix
@FlatSequenceMix ( sequences = { @OperationSequence({"login", "buy", "home" }), @OperationSequence({"search", "home" }) }, mix = { 25, 75 }, deviation = 2 )The resulting metric will be the number of the 4 operations (login, buy, search, home) in the time defined for each operation. The driver will expect 45.75% of the operations to be home (50% of 75% of the operations from browsing and 33% of 25% of the operations from shopping), 37.5% to be search, and 8.25% each for login and buy.
Modifier and Type | Class and Description |
---|---|
static class |
FlatSequenceMix.Selector
The selector implementation for the FlatSequenceMix.
|
Constructor and Description |
---|
FlatSequenceMix() |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
The clone operation for this object is a deep copy.
|
void |
configure(Element driverConfigNode)
Configures the flat mix based on the ratios given in the
configuration file.
|
FlatMix |
flatMix()
Returns the flat mix representation of this mix.
|
void |
init(Class<?> driverClass,
Annotation a)
Initializes this mix according to the annotation.
|
void |
init(OperationSequence[] seq)
Initialized the mix based on the defined sequences from the driver
annotations.
|
void |
normalize()
Normalizes the mix so each row will have a sum of 1.0d.
|
String[] |
operations()
Returns an array of the operation names used in this FlatMix.
|
FlatSequenceMix.Selector |
selector(Random random)
Obtains the per-thread and per-driver instance selector.
|
String |
toString()
Provides a string representation of this FlatSequenceMix.
|
void |
validate()
Validates the mix spec in the benchmark definitions to ensure all
the rows and columns are valid.
|
configureCycles, getLogger, getMix
public void init(Class<?> driverClass, Annotation a) throws DefinitionException
init
in class Mix
driverClass
- The driver class annotating this mixa
- The annotationDefinitionException
- If there is an error in the annotationpublic void init(OperationSequence[] seq)
seq
- An array of OperationSequence
public String[] operations()
public Object clone()
public void configure(Element driverConfigNode) throws ConfigurationException
configure
in class Mix
driverConfigNode
- The DOM node holding the driver configConfigurationException
- If the configuration is invalid
for the mixpublic void validate() throws DefinitionException
DefinitionException
- Found missing or
invalid row/columnpublic void normalize()
public FlatMix flatMix()
public String toString()
toString
in class Object
Object.toString()
public FlatSequenceMix.Selector selector(Random random)