|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.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 MixdriverClass - 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 OperationSequencepublic String[] operations()
public Object clone()
clone in class MixCloneable
public void configure(Element driverConfigNode)
throws ConfigurationException
configure in class MixdriverConfigNode - The DOM node holding the driver config
ConfigurationException - If the configuration is invalid
for the mix
public void validate()
throws DefinitionException
DefinitionException - Found missing or
invalid row/columnpublic void normalize()
normalize in class Mixpublic FlatMix flatMix()
flatMix in class Mixpublic String toString()
toString in class ObjectObject.toString()public FlatSequenceMix.Selector selector(Random random)
selector in class Mixrandom - The per-thread random value generator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||