Using Jenkins and Jmeter to build a scalable Load Testing solution
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. 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
4. Agenda
• Jmeter. Test Recording and
Playback.
• Composing Jmeter maven project
for Jenkins. Upload to Github.
• Tuning Jenkins and executing the
build.
• Results Analysis
6. Performance Testing tools
What tools have you used
for Performance-Testing?
What parameters were you
measuring?
What was your most
complex scenario?
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.
9. 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
11. 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.
12. 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
13. Prepare Jmeter test for integration.
Set these options in Thread Group, this
would be used by maven later
14. 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
15. 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.
16. 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
18. 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
19. 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
20. 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
25. 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
26. 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.
27. Response Codes per second
This graph will display the response code
per second returned during the test.
29. 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
30. 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