Load testing with gatling

20,547 views
20,696 views

Published on

Published in: Technology
1 Comment
19 Likes
Statistics
Notes
  • Hi Chris Birchall,
    Thanks for Knowledge sharing.
    Presentation is very Good for New Gatling learner.
    I have one question What is mean by 'à la Selenium' ?
    Using Selenium we can record scenarios from browser for Gatling?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
20,547
On SlideShare
0
From Embeds
0
Number of Embeds
4,385
Actions
Shares
0
Downloads
86
Comments
1
Likes
19
Embeds 0
No embeds

No notes for slide

Load testing with gatling

  1. 1. Load Testing with Gatling Chris Birchall 2013/12/6 #m3dev Tech Talk
  2. 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. 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. 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)
  5. 5. Scripting DSL val scn = scenario("Scenario name") .exec( http("request_1") .get("/") .headers(headers_1) .check(status.is(302))) .pause(0 milliseconds, 100 milliseconds) .exec(...
  6. 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. 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. 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
  9. 9. Internals ● ● ● ● ● Implemented in Scala AsyncHttpClient, Netty Akka Architecture details Example actor

×