SlideShare a Scribd company logo
Continuous performance
Load testing for developers with Gatling
Bert	Jan	Schrijver
@bjschrijverbertjan@openvalue.de
@bjschrijver@bjschrijver@bjschrijver
Bert Jan Schrijver
Let’s meet
@bjschrijver@bjschrijver
Let’s meet
Tim van Eijndhoven
@bjschrijver@bjschrijver@bjschrijver
Outline
• Performance testing process
• Introduction to Gatling
• Demo
• Results
• Looking forward
• Summary
• Q&A
@bjschrijver@bjschrijver@bjschrijver
How it all started…
@bjschrijver@bjschrijver@bjschrijver
Performance testing should be
part of the process
@bjschrijver@bjschrijver@bjschrijver
Performance testing traditionally…
…happens several times per year



…and/or at major releases



…is performed by specialists



.. which is far from ideal:



- changes were made long ago



- many different code changes



- at a certain moment in time



- when is a test required?



@bjschrijver@bjschrijver@bjschrijver
Traditional performance testing
design
write code
test code
performance test
release
unit tests
integration tests
@bjschrijver@bjschrijver@bjschrijver
design
write code
test code
release
unit tests
integration tests
performance tests
Performance testing in 

continuous delivery
@bjschrijver@bjschrijver@bjschrijver
Continuous Delivery
Demands code to be
Always production ready
Short feedback cycles
Maintained by self-supporting

teams
In regard to performance
Has to be under control
Effects should be clear ASAP
No external specialists
@bjschrijver@bjschrijver@bjschrijver
Part of the process
With the same level of support as

- Unit tests and integration tests

- Continuous Integration

- Zero-downtime deployments

Performed by the development team
@bjschrijver@bjschrijver@bjschrijver
Performance testing process
Design Record Operationalise Execute Report
@bjschrijver@bjschrijver@bjschrijver
Designing scenarios
Generic tests 

that test core functionality
Specialised tests 

that test specific features (hot spots) in depth
@bjschrijver@bjschrijver
Tool support is key for
performance test adoption
@bjschrijver@bjschrijver
Gatling
package computerdatabase // 1
import io.gatling.core.Predef._ // 2
import io.gatling.http.Predef._
import scala.concurrent.duration._
class BasicSimulation extends Simulation { // 3
val httpConf = http // 4
.baseURL("http://computer-database.gatling.io") // 5
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") // 6
.doNotTrackHeader("1")
.acceptLanguageHeader("en-US,en;q=0.5")
.acceptEncodingHeader("gzip, deflate")
.userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0")
val scn = scenario("BasicSimulation") // 7
.exec(http("request_1") // 8
.get("/")) // 9
.pause(5) // 10
setUp( // 11
scn.inject(atOnceUsers(1)) // 12
).protocols(httpConf) // 13
}
@bjschrijver@bjschrijver
Alternative tools
And many more…
@bjschrijver@bjschrijver
Gatling core concepts
Scenario
Feeder
A sequence of http requests used to simulate application usage
A tool used to fill request parameters
Recorder The tool used to record http requests or take a HAR-file 

and convert it to Gatling DSL
Gatling DSL Easy-to-read, developer-friendly way of defining tests
@bjschrijver@bjschrijver
Demo
@bjschrijver@bjschrijver
Scenario to outcome
Browser HAR-file
Gatling recorder DSL
Custom changes DSL
Gatling Report
@bjschrijver@bjschrijver
Demo
@bjschrijver@bjschrijver
Reports
@bjschrijver@bjschrijver@bjschrijver
Interpretations
We can

See how changes affect performance

Have feedback on performance in short amount of time



We cannot

See which load the application can endure in production

@bjschrijver@bjschrijver@bjschrijver
Results so far
- Prevented multiple issues in production
- Helped testing performance fixes and database tuning
- Discovered configuration error in test infrastructure
- Helped track down and validate a fix for a memory leak
- Helped tweak database indexes
- Made teams more aware of their product’s performance
@bjschrijver@bjschrijver@bjschrijver
- Automate (re-)recording process
- Re-use functional test scenarios as performance tests
- Eliminate custom code changes
Further development
@bjschrijver@bjschrijver@bjschrijver
Summary
@bjschrijver@bjschrijver@bjschrijver
Some take-aways
- Performance testing should be a first class citizen in your development cycle
- Frontend changes can impact backend performance
- Gatling is an awesome programmer friendly tool for load testing
- The approach we shared monitors performance trends - it does NOT
determine the maximum load a production environment can endure
https://github.com/timve/continuous-performance-demo
https://github.com/bertjan/gatling-seed
@bjschrijver@bjschrijver@bjschrijver
Questions?Questions?
@bjschrijver@bjschrijver@bjschrijver
Thanks for your time!
Liked it? Tweet it!
Slides: https://www.slideshare.net/BertJanSchrijver

More Related Content

PDF
OpenValue meetup January 2019 - Continuous performance - Load testing for dev...
PDF
JavaZone 2016: Continuous performance
PDF
JavaLand 2016: Continuous performance
PDF
JavaLand 2016 - Decoding the air around you with Java and $7 hardware
PPT
Agile - De Rol Van Tester
PDF
Fail fast Fail cheap - Agile Development, Testing & Delivery
PDF
JavaLand 2017 - Pipeline as code
PDF
PFZ Workshop - Automatiseren van functionele tests
OpenValue meetup January 2019 - Continuous performance - Load testing for dev...
JavaZone 2016: Continuous performance
JavaLand 2016: Continuous performance
JavaLand 2016 - Decoding the air around you with Java and $7 hardware
Agile - De Rol Van Tester
Fail fast Fail cheap - Agile Development, Testing & Delivery
JavaLand 2017 - Pipeline as code
PFZ Workshop - Automatiseren van functionele tests

Similar to JUGM meetup March 2019 - Continuous performance - Load testing for developers with Gatling (20)

PDF
Scrum - hou grip op uw ontwikkelproces
PPT
Sdb Presentatie
PPTX
ING : How top quality software and state-of-the-art technology leads to conti...
PDF
Coww 2.16 Presentatie Wim La Haye
PDF
BPUG Seminar 2014 Rik Marselis - effectief testen in agile
PPTX
Web applicatie van scratch
PPT
Workshop BI/DWH AGILE TESTING Zwitserleven Dutch
PPTX
Continuous delivery met jenkins twist en puppet
PDF
Hands-off performance testing - Twan Koot & Addy Zwiebel
PDF
DSD-NL 2014 - iMOD Symposium - 6. Reproduceerbaarheid en Kwaliteitsborging, W...
ODP
H6 Realisatiefase
PDF
Starten met geautomatiseerd testen - SDN 2013
PPTX
Presentatie Enterprise Architectuur - Agile en Essentie
PDF
Asl bi sl metrics themasessie 2013 devops sogeti
PPTX
SODA - Overdacht van digitaal archief in 10 stappen (Renée Cambré, voormalig ...
PPT
Agile, Continuous Delivery & DevOps in perspectief
PPT
Product risico analyse in de praktijk (2010) - Kees Blokland
PDF
TMap dag - Agile testautomatisering in de praktijk
PPTX
Presentatie dso leveranciersdag 17 november
PDF
Load En Stress Testers Te Slim Af Final
Scrum - hou grip op uw ontwikkelproces
Sdb Presentatie
ING : How top quality software and state-of-the-art technology leads to conti...
Coww 2.16 Presentatie Wim La Haye
BPUG Seminar 2014 Rik Marselis - effectief testen in agile
Web applicatie van scratch
Workshop BI/DWH AGILE TESTING Zwitserleven Dutch
Continuous delivery met jenkins twist en puppet
Hands-off performance testing - Twan Koot & Addy Zwiebel
DSD-NL 2014 - iMOD Symposium - 6. Reproduceerbaarheid en Kwaliteitsborging, W...
H6 Realisatiefase
Starten met geautomatiseerd testen - SDN 2013
Presentatie Enterprise Architectuur - Agile en Essentie
Asl bi sl metrics themasessie 2013 devops sogeti
SODA - Overdacht van digitaal archief in 10 stappen (Renée Cambré, voormalig ...
Agile, Continuous Delivery & DevOps in perspectief
Product risico analyse in de praktijk (2010) - Kees Blokland
TMap dag - Agile testautomatisering in de praktijk
Presentatie dso leveranciersdag 17 november
Load En Stress Testers Te Slim Af Final
Ad

JUGM meetup March 2019 - Continuous performance - Load testing for developers with Gatling