Class EntityLoadTestModel<M extends SwingEntityApplicationModel>
- java.lang.Object
-
- is.codion.swing.common.tools.loadtest.LoadTestModel<M>
-
- is.codion.swing.framework.tools.loadtest.EntityLoadTestModel<M>
-
- Type Parameters:
M
- the application model type used by this load test model
- All Implemented Interfaces:
LoadTest<M>
public abstract class EntityLoadTestModel<M extends SwingEntityApplicationModel> extends LoadTestModel<M>
A class for running multiple EntityApplicationModel instances for load testing purposes.
-
-
Field Summary
Fields Modifier and Type Field Description static PropertyValue<Integer>
LOAD_TEST_BATCH_SIZE
Specifies the initial client batch size
Value type: Integer
Default value: 10static PropertyValue<Integer>
LOAD_TEST_LOGIN_DELAY
Specifies the number which the max think time is multiplied with when initializing the clients
Value type: Integer
Default value: 2static PropertyValue<String>
LOAD_TEST_REMOTE_HOSTNAME
Specifies the hostname of the remote load test server
Value type: String
Default value: localhoststatic PropertyValue<Integer>
LOAD_TEST_THINKTIME
Specifies the initial think time setting for the load test client (max think time = thinktime, min think time = max think time / 2)
Value type: Integer
Default value: 2000-
Fields inherited from class is.codion.swing.common.tools.loadtest.LoadTestModel
DEFAULT_CHART_DATA_UPDATE_INTERVAL_MS, LOG, RANDOM
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EntityLoadTestModel(User user, Collection<? extends UsageScenario<M>> usageScenarios)
Instantiates a new EntityLoadTestModel.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract M
createApplication()
protected void
disconnectApplication(M application)
static void
selectRandomItem(EntityComboBoxModel comboBoxModel)
Selects a random non-null visible item in the given combobox model, if one is availablestatic void
selectRandomRow(EntityTableModel<?> tableModel)
Selects a random row in the given table modelstatic void
selectRandomRows(EntityTableModel<?> tableModel, double ratio)
Selects random rows in the given table modelstatic void
selectRandomRows(EntityTableModel<?> tableModel, int count)
Selects random rows in the given table modelString
title()
The title of this LoadTest-
Methods inherited from class is.codion.swing.common.tools.loadtest.LoadTestModel
addApplicationBatch, addShutdownListener, applicationBatchSizeValue, applicationCount, applicationCountObserver, collectChartDataState, getUpdateInterval, getUser, isScenarioEnabled, loginDelayFactorValue, maximumThinkTimeValue, memoryUsageDataset, minimumThinkTimeValue, numberOfApplicationsDataset, pausedState, removeApplicationBatch, resetChartData, runScenario, scenarioChooser, scenarioDurationDataset, setScenarioEnabled, setUpdateInterval, setUser, setWeight, shutdown, systemLoadDataset, thinkTime, thinkTimeDataset, usageScenario, usageScenarioDataset, usageScenarioFailureDataset, usageScenarios
-
-
-
-
Field Detail
-
LOAD_TEST_REMOTE_HOSTNAME
public static final PropertyValue<String> LOAD_TEST_REMOTE_HOSTNAME
Specifies the hostname of the remote load test server
Value type: String
Default value: localhost
-
LOAD_TEST_THINKTIME
public static final PropertyValue<Integer> LOAD_TEST_THINKTIME
Specifies the initial think time setting for the load test client (max think time = thinktime, min think time = max think time / 2)
Value type: Integer
Default value: 2000
-
LOAD_TEST_BATCH_SIZE
public static final PropertyValue<Integer> LOAD_TEST_BATCH_SIZE
Specifies the initial client batch size
Value type: Integer
Default value: 10
-
LOAD_TEST_LOGIN_DELAY
public static final PropertyValue<Integer> LOAD_TEST_LOGIN_DELAY
Specifies the number which the max think time is multiplied with when initializing the clients
Value type: Integer
Default value: 2
-
-
Constructor Detail
-
EntityLoadTestModel
protected EntityLoadTestModel(User user, Collection<? extends UsageScenario<M>> usageScenarios)
Instantiates a new EntityLoadTestModel. Note thatEntityApplicationModel.SCHEDULE_CONNECTION_VALIDATION
is set to false when this class is instantiated- Parameters:
user
- the default userusageScenarios
- the usage scenarios
-
-
Method Detail
-
title
public String title()
Description copied from interface:LoadTest
The title of this LoadTest- Specified by:
title
in interfaceLoadTest<M extends SwingEntityApplicationModel>
- Overrides:
title
in classLoadTestModel<M extends SwingEntityApplicationModel>
- Returns:
- the title
-
selectRandomRow
public static void selectRandomRow(EntityTableModel<?> tableModel)
Selects a random row in the given table model- Parameters:
tableModel
- the table model
-
selectRandomRows
public static void selectRandomRows(EntityTableModel<?> tableModel, int count)
Selects random rows in the given table model- Parameters:
tableModel
- the table modelcount
- the number of rows to select
-
selectRandomRows
public static void selectRandomRows(EntityTableModel<?> tableModel, double ratio)
Selects random rows in the given table model- Parameters:
tableModel
- the table modelratio
- the ratio of available rows to select
-
selectRandomItem
public static void selectRandomItem(EntityComboBoxModel comboBoxModel)
Selects a random non-null visible item in the given combobox model, if one is available- Parameters:
comboBoxModel
- the combobox model
-
disconnectApplication
protected final void disconnectApplication(M application)
- Specified by:
disconnectApplication
in classLoadTestModel<M extends SwingEntityApplicationModel>
- Parameters:
application
- the application to disconnect
-
createApplication
protected abstract M createApplication()
- Specified by:
createApplication
in classLoadTestModel<M extends SwingEntityApplicationModel>
- Returns:
- an initialized application.
-
-