Over a million developers have joined DZone.

Performance Testing Can Be as Simple as Unit Testing.

· Performance Zone

Discover 50 of the latest mobile performance statistics with the Ultimate Guide to Digital Experience Monitoring, brought to you in partnership with Catchpoint.

The first tool that comes in to mind when someone wants to do performance testing of Java server side applications is JMETER. It's free, opensource, and one of the best lightweight stable products to automate the performance/load testing.

Maven is another fantastic tool that helps to manage dependecies and build management. As we already know, maven takes care of running all our unit tests as part of a build.

Why not run your performance tests for every build to see if there is any bottleneck in performance?

If you are already familier with the JMeter and creating the test script file(.JMX file) for your application using jmeter, then it is as simple as compiling a Java project.

If you are not familier with JMeter then it is advisable to know this first: http://jmeter.apache.org/

Steps:

(1) Add the following plug-in your pom.xml file


<plugin>

  <groupId>com.lazerycode.jmeter</groupId>

  <artifactId>jmeter-maven-plugin</artifactId>

  <version>1.4</version>

  <executions>

  <execution>

  <id>jmeter-tests</id>

  <phase>verify</phase>

  <goals>

  <goal>jmeter</goal>

  </goals>

  </execution>

  </executions>

 </plugin>

 (2) Keep the performance JMeter's test script files in yourprojectdirectory/src/test/resources/jmeter/ directory.

 (3) Run the maven command:  mvn clean install

 (4) That's all, the maven command build, run the unit tests and then run the performance tests based on the scripts placed in src/test/jmeter/ directory.

 (5) Basic report (including success, failures, average response time, min and max response timings) in reports directory.

Is your APM strategy broken? This ebook explores the latest in Gartner research to help you learn how to close the end-user experience gap in APM, brought to you in partnership with Catchpoint.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}