-
Notifications
You must be signed in to change notification settings - Fork 9
Using Load Generators
There are several types of Load Generator methods that are available in the framework. All of which are helpers for Gatling's built in load injections (https://gatling.io/docs/2.3/general/simulation_setup).
Load is based on a Gatling User sequence which contains actions/queries and execs during a single second. If a scenario has multiple exec()
methods included in it then the total number of queries will be Gatling Users X execs. This is important to remember if using the repeat()
function from Gatling or having multiple chained queries in the same scenario.
Each of the load methods accept both a Gatling Scenario variable and a SimConf variable. The simConf is used to read the params found in the application.conf or runtime variables to determine the load to use. An error will be thrown if the load pattern being used cannot find the correct settings in the application.conf
file.
constantToTotal()
load pattern will auto-calculate the total amount of time to run the Simulation based on the usersConstantCnt
until the usersTotal
is reached.
Required Conf Parameters:
- usersConstantCnt: Int
- usersTotal: Int
Example:
constantScenario {
usersConstantCnt = 100
usersTotal = 1000
}
constantScenario
load will be: run 100 users per second for 10 seconds (1000/10)
rampUpToConstant()
load pattern will ramp up from 1 user to usersConstantCnt
users over usersConstantCnt
time and continue with usersConstantCnt
users for the duration of usersConstantTime
Required Conf Parameters:
- usersRampTime: Duration
- usersConstantCnt: Int
- usersConstantTime: Duration
Example:
myscenario {
usersRampTime = 10s
usersConstantCnt = 100
usersConstantTime = 30s
}
myscenario load will be: ramp from 1 to 100 users over 10s and continue with 100 users per second for 30 seconds
Note: If usersConstantCnt
= 1 the rampTime will be bypassed.
rampUpToPercentage()
load pattern will calculate the amount of users for each scenario in the Simulation based on the usersPercentage
found in each scenarios conf section.
When using this load pattern the usersRampTime
, usersConstantTime
, and usersConstantCnt
should be in the Simulations defaults
section and usersPercentage
should be set in each scenarios config section.
Required Conf Parameters:
- usersRampTime: Durations
- usersConstantTime: Duration
- usersConstantCnt: Int
- usersPercentage: Int
Example:
defaults {
usersRampTime = 10s
usersConstantCnt = 100
usersConstantTime = 30s
}
myscenario1 {
usersPercentage = 40
}
myscenario2 {
usersPercentage = 60
}
myscenario1 load will be: ramp from 1 to 40 users over 10s and continue with 40 users per second for 30 seconds
myscenario2 load will be: ramp from 1 to 60 users over 10s and continue with 40 users per second for 30 seconds
Note: If usersConstantCnt
= 1 the rampTime will be bypassed.
This method should be used for debugging purposes as it will only create a 1 User
Getting Started
Feeds
Fetching Base Data
Load Generators
Simulations
- CQL Executors
- Simulation Writing Shortcuts
- Using Custom ClusterBuilder Settings
- Using Client to Node SSL
Advanced Topics
- Dependent Queries
- Using Graphite and Grafana
- Debugging Simulations
- Adjusting input from Feed Before Executing a Query
Archived (v1.0) Topics