Module is.codion.swing.common.tools
Interface LoadTest<T>
-
- Type Parameters:
T
- the type of application used by this load test.
- All Known Implementing Classes:
EntityLoadTestModel
,LoadTestModel
,QueryLoadTestModel
public interface LoadTest<T>
Specifies a class for running multiple application instances for load testing purposes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addApplicationBatch()
Adds a batch of applications.Value<Integer>
applicationBatchSizeValue()
int
applicationCount()
ValueObserver<Integer>
applicationCountObserver()
void
clearChartData()
Clears the accumulated chart dataState
collectChartDataState()
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.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 scenariovoid
shutdown()
Removes all applications and exitsorg.jfree.data.xy.XYDataset
systemLoadDataset()
org.jfree.data.xy.XYDataset
thinkTimeDataset()
String
title()
The title of this LoadTestUsageScenario<T>
usageScenario(String usageScenarioName)
org.jfree.data.xy.XYDataset
usageScenarioDataset()
org.jfree.data.xy.XYDataset
usageScenarioFailureDataset()
Collection<String>
usageScenarios()
-
-
-
Method Detail
-
shutdown
void shutdown()
Removes all applications and exits
-
getUser
User getUser()
- Returns:
- the user to use when initializing new application instances
-
setUser
void setUser(User user)
- Parameters:
user
- the user to use when initializing new application instances
-
title
String title()
The title of this LoadTest- Returns:
- the title
-
setWeight
void setWeight(String scenarioName, int weight)
Sets the random chooser weight for the given scenario- Parameters:
scenarioName
- the name of the scenarioweight
- the new weight to assign to the scenario
-
isScenarioEnabled
boolean isScenarioEnabled(String scenarioName)
- Parameters:
scenarioName
- the scenario name- Returns:
- true if the scenario is enabled
-
setScenarioEnabled
void setScenarioEnabled(String scenarioName, boolean enabled)
- Parameters:
scenarioName
- the scenario nameenabled
- true if the scenario should be enabled
-
usageScenarios
Collection<String> usageScenarios()
- Returns:
- the names of the usage scenarios used by this load test.
-
usageScenario
UsageScenario<T> usageScenario(String usageScenarioName)
- Parameters:
usageScenarioName
- the scenario name- Returns:
- the usage scenario
-
getUpdateInterval
int getUpdateInterval()
- Returns:
- the chart data update interval in milliseconds
-
setUpdateInterval
void setUpdateInterval(int updateInterval)
- Parameters:
updateInterval
- the chart data update interval in milliseconds
-
applicationCount
int applicationCount()
- Returns:
- the number of active applications
-
applicationBatchSizeValue
Value<Integer> applicationBatchSizeValue()
- Returns:
- the Value controlling the number of applications to initialize per batch
-
pausedState
State pausedState()
- Returns:
- the state controlling the paused state of this load test
-
maximumThinkTimeValue
Value<Integer> maximumThinkTimeValue()
- Returns:
- the Value controlling the maximum number of milliseconds that should pass between work requests
-
minimumThinkTimeValue
Value<Integer> minimumThinkTimeValue()
- Returns:
- the Value controlling the minimum number of milliseconds that should pass between work requests
-
loginDelayFactorValue
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.- Returns:
- the Value controlling the factor with which to multiply the think time when logging in
-
collectChartDataState
State collectChartDataState()
- Returns:
- the state controlling whether this load test collects chart data
-
applicationCountObserver
ValueObserver<Integer> applicationCountObserver()
- Returns:
- an observer notified each time the application count changes
-
addApplicationBatch
void addApplicationBatch()
Adds a batch of applications.- See Also:
applicationBatchSizeValue()
-
removeApplicationBatch
void removeApplicationBatch()
Removes one batch of applications.- See Also:
applicationBatchSizeValue()
-
clearChartData
void clearChartData()
Clears the accumulated chart data
-
scenarioDurationDataset
org.jfree.data.xy.IntervalXYDataset scenarioDurationDataset(String name)
- Parameters:
name
- the scenario name- Returns:
- a dataset plotting the average scenario duration
-
thinkTimeDataset
org.jfree.data.xy.XYDataset thinkTimeDataset()
- Returns:
- a dataset plotting the think time
-
numberOfApplicationsDataset
org.jfree.data.xy.XYDataset numberOfApplicationsDataset()
- Returns:
- a dataset plotting the number of active applications
-
usageScenarioDataset
org.jfree.data.xy.XYDataset usageScenarioDataset()
- Returns:
- a dataset plotting the number of runs each usage scenario is being run per second
-
memoryUsageDataset
org.jfree.data.xy.XYDataset memoryUsageDataset()
- Returns:
- a dataset plotting the memory usage of this load test model
-
systemLoadDataset
org.jfree.data.xy.XYDataset systemLoadDataset()
- Returns:
- a dataset plotting the system load of this load test model
-
usageScenarioFailureDataset
org.jfree.data.xy.XYDataset usageScenarioFailureDataset()
- Returns:
- a dataset plotting the failure rate of each usage scenario
-
scenarioChooser
ItemRandomizer<UsageScenario<T>> scenarioChooser()
- Returns:
- the randomizer used to select scenarios
-
-