Professional Documents
Culture Documents
performance testing
using Maven & JMeter
George Barnett, Atlassian Software Systems
@georgebarnett
• Create controllable JMeter tests
• Configure Maven to create a repeatable cycle
• Run this “build” in your CI server every 8 hours
• Find performance regressions faster
WHY?
• Catch regressions quickly
• Stop hunting for bugs
• Code with confidence
• Know the performance cost of features
• Fearless external dependency upgrades
• Go home on time
ATLASSIAN
• 15,000+ customers
• 100+ developers
• 8 software streams
• 1 performance engineer
ATLASSIAN
• JMeter
• Maven & plugins
• Bamboo & plugins
• A Profiler
JMETER
• Apache Project
• Java
• Supports HTTP, JDBC, SOAP, XML-RPC,
FTP, SMTP, LDAP, JUnit & more.
MAVEN
• Apache Project
• Java
• Build Tool
• Dependency management
• Documentation
MAVEN CONCEPTS
• Project Object Model (POM)
• Standardised directory structure
• Build Lifecycle
• Reporting Lifecycle
• Plugins
MAVEN POM
<project>
<groupid>com.atlassian.com.performance.jira</groupid>
<artifactid>automated-performance</artifactid>
<properties>
<test.dataset>/opt/dataset/dataset1.zip</test.dataset>
</properties>
<build>
<!--Main Lifecycle plugins configured here-->
</build>
<reporting>
<!--Reporting Lifecycle here-->
</reporting>
</project>
MAVEN PLUGINS
• Chronos
• Ant-run
• Cargo
• Maven Assembly plugin
• Maven Dependency plugin
BAMBOO
• Continuous Integration
• Can run builds on Amazon’s EC2
• JMeter Aggregator Plugin
A PROFILER
• Java Profiler
• CPU Snapshots
• GC & Memory information
• Thread usage and contention
• Triggers & offline sampling
STEP 1
Package the JMeter test
<profile>
<id>dataset1</id>
<properties>
<test.dataset>/opt/dataset/dataset1.zip</test.dataset>
..
<profile>
<id>dataset2</id>
<properties>
<test.dataset>/opt/dataset/dataset2.zip</test.dataset>
..
MAVEN PROFILES
• Invoked on command line
• eg: mvn verify -Pmysql, tomcat5, dataset1
<global.jvm.args>-Xms2000m -Xloggc:${project.build.directory}/gc.log</global.jvm.args>
<jvm.args>${global.jvm.args}</jvm.args>
<profile>
<id>jprofiler</id>
<properties>
<jvm.args>-agentlib:jprofilerti=offline,id=${jprofiler.profileid},config=${jprofiler.configfile} -
Xbootclasspath/a:${jprofiler.home}/bin/agent.jar ${global.jvm.args}</jvm.args>
</properties>
</profile>
REPORTING
CHRONOS
• Available in maven
• eg: mvn site / mvn chronos:report
@georgebarnett