2. Gatling
Simulation Scripts written in Scala
Gatling runtime interprets Scala scripts and runs the tests
Virtual Users invoking series of APIs concurrently
Define test scenarios
Feeders to inject runtime values for tests
Record & Replay
4. • Immutability
• vals rule
• no one messes with my data
• Functions
• def a function
• parameters, yes with default
• return more than one, really ?
• no side effects
• function composition
• functions as first class citizens
• Object Oriented Scala
• Classes, Objects, Traits
• Collections
• No more looping
• How to do => What to do
Lets see in Action - ScalaREPL
5. Now , get back to
Load Testing REST APIs
using Gatling
6. Pre-Requisites
• Install sbt
• configure gatling plugin
• build and run tests
• Install ScalaIDE
• so that we can write code
7. Gatling Simulation
• Create Scenarios
• define execution steps
• supports http/s or Websockets
• chain the steps together
• Inject pause times for simulating real life events
• Trigger Scenario
• Rampup Virtual Users
• Execute scenarios
• Specify either the duration / iteration count
• Feeders
• Use feeders to inject runtime varying values
• feed values for every iteration of the scenario
8. Run Test
• Using sbt
• sbt test
• sbt ‘testOnly com.myorg.api.load.MyApiLoadTest’
• Trigger From Jenkins
• Use Jenkins SBT plugin and Gatling Plugin
• Archive Load test reports
• Report failure using TextFinderPlugin
• Test Report
• reports in <Project>/target/gatling/*