Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Using Jenkins and Jmeter to build a scalable Load Testing solution


Published on

A tutorial how to use opensource tools for using Jmeter Load Testing in Continuous Integration.

Published in: Technology

Using Jenkins and Jmeter to build a scalable Load Testing solution

  1. 1. Hier soll der Titel reinNon-Functional Testing Organizer: imbus AG Using Jenkins and Jmeter to build a scalable Load Testing solution Ruslan Strazhnyk CipherHealth LLC
  2. 2. About me • Ruslan Strazhnyk – Lviv(Lemberg), Ukraine – Rich experience in creating and supporting Test Automation Frameworks and infrastructure – Front-end, Back-end, API, Performance Testing – Languages: Ruby, Python, Java, JS – Experience with cloud services – Technologies: Selenium, REST, Jenkins, JMeter, Openstack
  3. 3. Where I work
  4. 4. Agenda • Jmeter. Test Recording and Playback. • Composing Jmeter maven project for Jenkins. Upload to Github. • Tuning Jenkins and executing the build. • Results Analysis
  5. 5. Load Testing
  6. 6. Performance Testing tools What tools have you used for Performance-Testing? What parameters were you measuring? What was your most complex scenario?
  7. 7. Performance Testing Classic Scheme • Identify Test Environment • Identify Performance Acceptance Criteria • Plan and Design Tests • Configure Test Environment • Implement Test Design • Execute Test • Analyze Results
  8. 8. JMeter • HTTP(S) coverage • REST coverage • Portability and 100% Java purity • Full multi-threading ability • GUI designed for Composing Test Plans/Debug • Data visualization plug-ins • Unlimited testing capabilities using plug-ins
  9. 9. JMeter
  10. 10. Prepare Jmeter test for non-UI mode. • Download JMeter from official page. • Unzip it to specified folder. • Download JMeterPlugins-standard from additional Plug-ins page. • Extract archive contents to JMeter installation directory. • Restart Jmeter to be able to add new plug- ins.
  11. 11. Prepare Jmeter test for integration. Now add these Listeners to the test plan Right-click via Add > Listener • jp@gc – Console Status Logger • jp@gc – Active Threads Over Time • jp@gc – Response Over Time • jp@gc – Transactions per Second • View Results Tree
  12. 12. Prepare Jmeter test for integration. Set these options in Thread Group, this would be used by maven later
  13. 13. Maven Yiddish word meaning accumulator of knowledge Maven’s Objectives: • Making the build process easy • Providing a uniform building system • Providing quality project information • Providing guidelines for best practices • Allowing transparent migration to new features Maven plug-ins used: • clean – cleans after the build • compiler – compiles Java sources • install – install built artifact into local repository • more plugins -
  14. 14. Preparing Maven project JMeter tests are integrated into a maven build and automatically generate graphs from the test results using the jmeter plugin CMDRunner. “jmeter-maven-plugin” is used to integrate jmeter in the maven build. To generate graphs from the jmeter results, the “jmeter-graph-maven-plugin” is used.
  15. 15. Preparing Maven project Maven config file pom.xml is already parameterized for Jenkins build Jmeter tests are simply stored in the directory /src/test/jmeter
  16. 16. Maven
  17. 17. Jenkins • Pre-installed Jenkins VM (Ubuntu 14.04) • What’s in pre-configured VM: – Installed Java-JRE for maven and Jenkins – Installed maven 3.3, github, vim – Configured Github account – Installed Intellij Idea • Install additional JMeter-Performance plug-in and GitHub plug-in
  18. 18. Build Jenkins job • Set parameterization values – THREAD COUNT – LOOP COUNT • Set Github repository • Set build trigger (SNAPSHOT dependancy) • Set build step – Root POM – Goals and options • Publish Performance Test Result report
  19. 19. Jenkins Performance plugin • allows you to capture reports from JMeter and JUnit . • Jenkins will generate graphic charts with the trend report of performance and robustness. • it includes the feature of setting the final build status as good, unstable or failed, based on the reported error percentage. •
  20. 20. HTML Report Auto-generation
  21. 21. HTML Report Auto-generation Basic graphs are already generated with html
  22. 22. jmeter-graph-maven-plugin
  23. 23. Batteries Included: Ability to Generate More Graphs How to add new graph
  24. 24. Batteries Included: Ability to Generate More Graphs With the simple manipulation, it is possible to generate up to 11 Graphical Metrics for different KPI’s
  25. 25. Response Times Distribution This graph will display the response time distribution of the test. The X axis shows the response times grouped by interval, and the Y axis the number of samples which are contained in each interval.
  26. 26. Response Codes per second This graph will display the response code per second returned during the test.
  27. 27. More beautiful graphs
  28. 28. What’s next? Generate pom.xml files for the project with Ruby Ruby-jmeter – generate jmx scenario programatically
  29. 29. Summary • Up-sides: – Building working solution from OpenSource components (no license payment, fees etc.) – Full customization – Integration capabilities • Down-sides: – Experience needed to set-up and work with it – Needs dive-in to maven to be able to customize builds
  30. 30. External Resources • Jmeter • Jmeter plug-ins • Jenkins • the-pom.html • started/ • • generating-nice-graphs-at-end-of-your-load-test-with-apache- jmeter-and-jmeter-plugins/ •
  31. 31. Questions and Answers My contacts Skype - ruslanstrazhnyk Twitter - @strazhnyk E-mail –