T
- the type of the applications this load test usespublic abstract class LoadTestModel<T> extends Object implements LoadTest<T>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CHART_DATA_UPDATE_INTERVAL_MS |
protected static org.slf4j.Logger |
LOG |
protected static Random |
RANDOM |
Modifier | Constructor and Description |
---|---|
protected |
LoadTestModel(User user,
Collection<? extends UsageScenario<T>> usageScenarios,
int maximumThinkTime,
int loginDelayFactor,
int applicationBatchSize)
Constructs a new LoadTestModel.
|
Modifier and Type | Method and Description |
---|---|
void |
addApplicationBatch()
Adds a batch of applications.
|
protected void |
addShutdownListener(EventListener listener) |
Value<Integer> |
applicationBatchSizeValue() |
int |
applicationCount() |
ValueObserver<Integer> |
applicationCountObserver() |
State |
collectChartDataState() |
protected abstract T |
createApplication() |
protected abstract void |
disconnectApplication(T application) |
int |
getUpdateInterval() |
User |
getUser() |
boolean |
isScenarioEnabled(String scenarioName) |
Value<Integer> |
loginDelayFactorValue()
This value controls the factor with which to multiply the think time when logging in, this helps
spread the application logins when creating a batch of application.
|
Value<Integer> |
maximumThinkTimeValue() |
org.jfree.data.xy.XYDataset |
memoryUsageDataset() |
Value<Integer> |
minimumThinkTimeValue() |
org.jfree.data.xy.XYDataset |
numberOfApplicationsDataset() |
State |
pausedState() |
void |
removeApplicationBatch()
Removes one batch of applications.
|
void |
resetChartData()
Resets the accumulated chart data
|
protected void |
runScenario(UsageScenario<T> usageScenario,
T application)
Runs the scenario with the given name on the given application
|
ItemRandomizer<UsageScenario<T>> |
scenarioChooser() |
org.jfree.data.xy.IntervalXYDataset |
scenarioDurationDataset(String name) |
void |
setScenarioEnabled(String scenarioName,
boolean enabled) |
void |
setUpdateInterval(int updateInterval) |
void |
setUser(User user) |
void |
setWeight(String scenarioName,
int weight)
Sets the random chooser weight for the given scenario
|
void |
shutdown()
Removes all applications and exits
|
org.jfree.data.xy.XYDataset |
systemLoadDataset() |
protected int |
thinkTime() |
org.jfree.data.xy.XYDataset |
thinkTimeDataset() |
String |
title()
The title of this LoadTest
|
UsageScenario<T> |
usageScenario(String usageScenarioName) |
org.jfree.data.xy.XYDataset |
usageScenarioDataset() |
org.jfree.data.xy.XYDataset |
usageScenarioFailureDataset() |
Collection<String> |
usageScenarios() |
public static final int DEFAULT_CHART_DATA_UPDATE_INTERVAL_MS
protected static final org.slf4j.Logger LOG
protected static final Random RANDOM
protected LoadTestModel(User user, Collection<? extends UsageScenario<T>> usageScenarios, int maximumThinkTime, int loginDelayFactor, int applicationBatchSize)
user
- the default user to use when initializing applicationsusageScenarios
- the usage scenarios to usemaximumThinkTime
- the maximum think time, by default the minimum think time is max / 2loginDelayFactor
- the value with which to multiply the think time when delaying loginapplicationBatchSize
- the number of applications to add in a batchpublic final User getUser()
public final void setUser(User user)
public final UsageScenario<T> usageScenario(String usageScenarioName)
usageScenario
in interface LoadTest<T>
usageScenarioName
- the scenario namepublic final Collection<String> usageScenarios()
usageScenarios
in interface LoadTest<T>
public final void setWeight(String scenarioName, int weight)
LoadTest
public final boolean isScenarioEnabled(String scenarioName)
isScenarioEnabled
in interface LoadTest<T>
scenarioName
- the scenario namepublic final void setScenarioEnabled(String scenarioName, boolean enabled)
setScenarioEnabled
in interface LoadTest<T>
scenarioName
- the scenario nameenabled
- true if the scenario should be enabledpublic final ItemRandomizer<UsageScenario<T>> scenarioChooser()
scenarioChooser
in interface LoadTest<T>
public final org.jfree.data.xy.IntervalXYDataset scenarioDurationDataset(String name)
scenarioDurationDataset
in interface LoadTest<T>
name
- the scenario namepublic final org.jfree.data.xy.XYDataset thinkTimeDataset()
thinkTimeDataset
in interface LoadTest<T>
public final org.jfree.data.xy.XYDataset numberOfApplicationsDataset()
numberOfApplicationsDataset
in interface LoadTest<T>
public final org.jfree.data.xy.XYDataset usageScenarioDataset()
usageScenarioDataset
in interface LoadTest<T>
public final org.jfree.data.xy.XYDataset usageScenarioFailureDataset()
usageScenarioFailureDataset
in interface LoadTest<T>
public final org.jfree.data.xy.XYDataset memoryUsageDataset()
memoryUsageDataset
in interface LoadTest<T>
public final org.jfree.data.xy.XYDataset systemLoadDataset()
systemLoadDataset
in interface LoadTest<T>
public final void resetChartData()
LoadTest
resetChartData
in interface LoadTest<T>
public final int getUpdateInterval()
getUpdateInterval
in interface LoadTest<T>
public final void setUpdateInterval(int updateInterval)
setUpdateInterval
in interface LoadTest<T>
updateInterval
- the chart data update interval in millisecondspublic final int applicationCount()
applicationCount
in interface LoadTest<T>
public final Value<Integer> applicationBatchSizeValue()
applicationBatchSizeValue
in interface LoadTest<T>
public final void addApplicationBatch()
LoadTest
addApplicationBatch
in interface LoadTest<T>
LoadTest.applicationBatchSizeValue()
public final void removeApplicationBatch()
LoadTest
removeApplicationBatch
in interface LoadTest<T>
LoadTest.applicationBatchSizeValue()
public final State pausedState()
pausedState
in interface LoadTest<T>
public final State collectChartDataState()
collectChartDataState
in interface LoadTest<T>
public final void shutdown()
LoadTest
public final Value<Integer> maximumThinkTimeValue()
maximumThinkTimeValue
in interface LoadTest<T>
public final Value<Integer> minimumThinkTimeValue()
minimumThinkTimeValue
in interface LoadTest<T>
public final Value<Integer> loginDelayFactorValue()
LoadTest
loginDelayFactorValue
in interface LoadTest<T>
public final ValueObserver<Integer> applicationCountObserver()
applicationCountObserver
in interface LoadTest<T>
protected final void runScenario(UsageScenario<T> usageScenario, T application)
usageScenario
- the scenario to runapplication
- the application to useprotected void addShutdownListener(EventListener listener)
listener
- a listener notified when this load test model has been shutdown.protected abstract T createApplication()
CancelException
- in case the initialization was cancelledprotected abstract void disconnectApplication(T application)
application
- the application to disconnectprotected final int thinkTime()
minimumThinkTimeValue()
,
maximumThinkTimeValue()