O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Using Jenkins and Jmeter to build a scalable Load Testing solution

1.686 visualizações

Publicada em

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

Publicada em: Tecnologia

Using Jenkins and Jmeter to build a scalable Load Testing solution

  1. 1. Hier soll der Titel reinNon-Functional Testing www.qs-tag.de Organizer: imbus AG www.qs-tag.de 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 https://cipherhealth.com/
  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 - https://maven.apache.org/plugins/index.html
  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. • https://wiki.jenkins-ci.org/display/JENKINS/Performance+Plugin
  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 http://jmeter-plugins.org/wiki/Start/
  28. 28. What’s next? Generate pom.xml files for the project with Ruby http://www.nokogiri.org/ Ruby-jmeter – generate jmx scenario programatically https://github.com/flood-io/ruby-jmeter
  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 http://jmeter.apache.org/ • Jmeter plug-ins http://jmeter-plugins.org • Jenkins http://jenkins-ci.org • https://maven.apache.org/guides/introduction/introduction-to- the-pom.html • https://lincolnloop.com/blog/load-testing-jmeter-part-1-getting- started/ • https://wiki.opendaylight.org/view/Install_On_Ubuntu_14.04 • https://www.ubik-ingenierie.com/blog/automatically- generating-nice-graphs-at-end-of-your-load-test-with-apache- jmeter-and-jmeter-plugins/ • https://github.com/smarigowda/jmeter-maven-example
  31. 31. Questions and Answers My contacts Skype - ruslanstrazhnyk Twitter - @strazhnyk E-mail – strazhnyk@gmail.com

×