|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.faban.driver.engine.Mix com.sun.faban.driver.engine.FlatSequenceMix
public class FlatSequenceMix
The implementation of the flat sequence mix annotation.
This mix allows you to specify a set of sequences of operations. For
example, a workload may define two scenarios: shopping and browsing.
The shopping operation itself is made up of three ordered operations (login,
buy, home) and the browsing operation is made up of two operations
(search, home). Say that 75% of the workload is browsing and 25% of
the workload is shopping. Such a mix of operations would be represented
like this:
@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.
Nested Class Summary | |
---|---|
static class |
FlatSequenceMix.Selector
The selector implementation for the FlatSequenceMix. |
Field Summary |
---|
Fields inherited from class com.sun.faban.driver.engine.Mix |
---|
className |
Constructor Summary | |
---|---|
FlatSequenceMix()
|
Method Summary | |
---|---|
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. |
Methods inherited from class com.sun.faban.driver.engine.Mix |
---|
getLogger, getMix |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FlatSequenceMix()
Method Detail |
---|
public void init(Class<?> driverClass, Annotation a) throws DefinitionException
init
in class Mix
driverClass
- The driver class annotating this mixa
- The annotation
DefinitionException
- If there is an error in the annotationpublic void init(OperationSequence[] seq)
seq
- An array of OperationSequence
public String[] operations()
public Object clone()
clone
in class Mix
Cloneable
public void configure(Element driverConfigNode) throws ConfigurationException
configure
in class Mix
driverConfigNode
- The DOM node holding the driver config
ConfigurationException
- If the configuration is invalid
for the mixpublic void validate() throws DefinitionException
DefinitionException
- Found missing or
invalid row/columnpublic void normalize()
normalize
in class Mix
public FlatMix flatMix()
flatMix
in class Mix
public String toString()
toString
in class Object
Object.toString()
public FlatSequenceMix.Selector selector(Random random)
selector
in class Mix
random
- The per-thread random value generator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |