Sunteți pe pagina 1din 5

JMeter / Jenkins Scalable CI Performance Testing Solution

I've worked with JMeter/Jenkins before for CI perf testing and I'd say it's the best out of the box
solution currently (having been in a team investigating lots of other solutions from LoadRunner
to Grinder). It offers immediate plug and play, quick script design and great graphics.

But previously I'd been limited to one JMeter load injector and hadn't looked for a fully scalable
solution because I had other tools for that purpose. But this solution provides full scalability and
opens the doors for full on CI performance testing - perhaps run overnight due to time scales so
maybe not strictly CI, depending on your setup.

So on this page I'll show how all the above comes together to give plug and play Jenkins CI.

The ultimate aim of the CI part of this project is to have performance testing as part of the
daily (or hourly) build and to quickly pick up on any introduced performance issues. We are
after reports showing performance and failures and of course a failure should stop the build -
Maybe - this is open to discussion - the trouble with performance stopping the build is it
interrupts the functional teams from working and it may not be the most efficient solution. If
you don't want to stop the build, set the performance requirements higher.
Tip of the day: bash scripting is easier if you DON'T have spaces in your
project names, like I did (!):
As seen on the controller page, to use jenkins we simply run the tests from a Jenkins shell. in
this case, we run the test on 3 hosts, copy results to the workspace and check on two
transactions for their 95th percentile values:

Do check the JM ToDo page as there are a few more steps that I do need to add to this build
process before using it in earnest. See here and here

NOTE: The $WORKSPACE variable does not currently work in Jenkins under windows. This
has been a long standing known issue. If you are working under windows, you must hard
code the workspace path for each project.

Post build, we copy the projects artifacts over from the workspace to the build directory.
This is just for later scrutiny if needed. I do limit the number of builds to keep but you may
want to review this policy depending on disc space and your specific requirements:

Also add a post build step to publish the performance test results in the JMeter plugin:
If you are using Jenkins with the EC2 API tools (sparking up injectors and tearing them down
etc.), you will need to set up the Jenkins user profile. By default this user doesn't seem to
have a .profile or .bashrc but you should be able to copy over the ubuntu .profile. Switch to
user jenkins with 'sudo su jenkins', go to the home directory (cd ~), in my case
'/var/lib/jenkins' and edit (or make) the .profile there.

You should have something like the following in the jenkins user's .profile:

PATH=$PATH:/usr/local/apache-jmeter-2.9/bin
export PATH
export JAVA_HOME=/usr
export EC2_HOME=/usr/local/ec2-api-tools
export PATH=$PATH:$EC2_HOME/bin

export AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXX
export AWS_SECRET_KEY=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
export EC2_URL=https://ec2.eu-west-1.amazonaws.com

Restart Jenkins to pick up the changes with:

sudo /etc/init.d/jenkins restart

Here is the latest Jenkins script, including a check on environment variables, a test to make
sure the jmeter script ran before we do the analysis and a call to the latest rate-check.sh
script:
[Home] [About (CV)] [Contact Us] [JMeter Cloud] [JM Highlights] [JM Overview] [JM Control] [JM Inject] [JM Threads]
[JM Results] [JM Assertions] [JM TPS] [JM Metrics] [JM Runtime] [JM Collation] [JM Logs] [JM 95th] [JM 95th v2]
[JM Jenkins] [JM Corporate] [JM Scripts] [JM Variables] [JM Embedded] [JM Hosts] [JM Running] [JM Example]
[JM Versions] [webPageTest] [_64 images] [asset moniitor] [Linux Monitor] [Splunk ETL] [Splunk API] [AWS bash]
[LR Rules OK] [LR Slave] [LR CI Graphs] [LoadRunner CI] [LR CI Variables] [LR Bamboo] [LR Methods] [LR CI BASH]
[Bash methods] [Jenkins V2] [Streaming vid] [How fast] [Finding Issues] [Reporting] [Hand over] [VB Scripts]
[JMeter tips] [JMeter RAW] [Dynatrace] [Documents] [FAQ] [Legal]
In the Cartesian Elements Ltd
group of companies

S-ar putea să vă placă și