Interface LoadTestModel<T>
- Type Parameters:
T- the type of application used by this load test.
public interface LoadTestModel<T>
Specifies a class for running multiple application instances for load testing purposes.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDescribes a load test application.static interfaceBuilds aLoadTestModel. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a batch of applications.voidaddShutdownListener(Runnable listener) is.codion.common.value.Value<Integer>is.codion.common.value.ValueObserver<Integer>is.codion.swing.common.model.component.table.FilteredTableModel<LoadTestModel.Application,Integer> is.codion.common.state.Statestatic <T> LoadTestModel.Builder<T>voidClears the accumulated chart datais.codion.common.state.StateintbooleanisScenarioEnabled(String scenarioName) is.codion.common.value.Value<Integer>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.is.codion.common.value.Value<Integer>org.jfree.data.xy.XYDatasetis.codion.common.value.Value<Integer>org.jfree.data.xy.XYDatasetis.codion.common.state.Statepaused()voidRemoves one batch of applications.voidRemoves the selected applicationsorg.jfree.data.xy.IntervalXYDatasetvoidsetScenarioEnabled(String scenarioName, boolean enabled) voidsetUpdateInterval(int updateInterval) voidSets the random chooser weight for the given scenariovoidshutdown()Removes all applications and exitsorg.jfree.data.xy.XYDatasetorg.jfree.data.xy.XYDatasettitle()The title of this LoadTestusageScenario(String usageScenarioName) org.jfree.data.xy.XYDatasetorg.jfree.data.xy.XYDatasetis.codion.common.value.Value<is.codion.common.user.User>user()
-
Method Details
-
shutdown
void shutdown()Removes all applications and exits -
user
is.codion.common.value.Value<is.codion.common.user.User> user()- Returns:
- the user to use when initializing new application instances
-
applicationTableModel
is.codion.swing.common.model.component.table.FilteredTableModel<LoadTestModel.Application,Integer> applicationTableModel()- Returns:
- a table model for displaying the active application instances
-
title
String title()The title of this LoadTest- Returns:
- the title
-
setWeight
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
- Parameters:
scenarioName- the scenario name- Returns:
- true if the scenario is enabled
-
setScenarioEnabled
- 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
- 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
-
addShutdownListener
- Parameters:
listener- a listener notified when this load test model has been shutdown.
-
applicationBatchSize
is.codion.common.value.Value<Integer> applicationBatchSize()- Returns:
- the Value controlling the number of applications to initialize per batch
-
paused
is.codion.common.state.State paused()- Returns:
- the state controlling the paused state of this load test
-
maximumThinkTime
is.codion.common.value.Value<Integer> maximumThinkTime()- Returns:
- the Value controlling the maximum number of milliseconds that should pass between work requests
-
minimumThinkTime
is.codion.common.value.Value<Integer> minimumThinkTime()- Returns:
- the Value controlling the minimum number of milliseconds that should pass between work requests
-
loginDelayFactor
is.codion.common.value.Value<Integer> loginDelayFactor()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
-
collectChartData
is.codion.common.state.State collectChartData()- Returns:
- the state controlling whether this load test collects chart data
-
autoRefreshApplications
is.codion.common.state.State autoRefreshApplications()- Returns:
- the state controlling whether the applications table model is automatically refreshed
-
applicationCount
is.codion.common.value.ValueObserver<Integer> applicationCount()- Returns:
- an observer notified each time the application count changes
-
addApplicationBatch
void addApplicationBatch()Adds a batch of applications.- See Also:
-
removeApplicationBatch
void removeApplicationBatch()Removes one batch of applications.- See Also:
-
removeSelectedApplications
void removeSelectedApplications()Removes the selected applications -
clearCharts
void clearCharts()Clears the accumulated chart data -
scenarioDurationDataset
- 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
-
builder
static <T> LoadTestModel.Builder<T> builder(Function<is.codion.common.user.User, T> applicationFactory, Consumer<T> closeApplication) - Type Parameters:
T- the application type- Parameters:
applicationFactory- the application factorycloseApplication- closes an application- Returns:
- a new builder
-