2. Existing (free) load test tools
● Siege
○ Simple, classic (first released in 2000?)
○ Limited scripting support
● JMeter
○ Scripting via UI, or lots of XML
3. Gatling
● Powerful scripting using Scala DSL
● Record scenarios from browser, à la
Selenium
● Run multiple scenarios in one simulation
● Graphical reports with pretty graphs
4. Getting started
1. Download (gatling-tool.org) and unzip
2. Create a simulation
a. write from scratch using DSL, or
b. record using Recorder
3. Run bin/gatling.sh
a. Interactive CLI - choose simulation to run
4. View HTML report (sample)
6. DSL - Advanced features (1)
Loading data from CSV file
scenario(“login”)
.feed(csv("user_credentials.csv"))
.exec(
http("request_3")
.post("/login")
.param("username", "${username}")
.param("password", "${password}")
...
username,password
user1,password1
user2,password2
user3,password3
user4,password4
user5,password5
user6,password6
user7,password7
user8,password8
user9,password9
user10,password10
Can also load from JDBC/Redis/custom file format/...
7. DSL - Advanced features (2)
Reading data from page, re-using it later
http("find_account_id")
.get("/accounts.html")
.check(regex("""<td class="number">ACC(d+)</td>""")
.saveAs("account_id")))
.pause(7, 8)
.exec(
http("account_details_page")
.get("/account/ACC${account_id}/operations.html")
...
8. Recording scenarios
1. bin/recorder.sh
a. starts a Swing GUI
2. Customise scenario config
a. set filters to limit which requests are recorded
3. Click “Start!” button
a. starts an HTTP proxy on localhost:8000
4. Browse any site via the proxy
5. Click “Stop and save”
a. Generates a DSL script