Carlos Fillol, Antonio Calero
Compatibility with Sonar
Description / Features
This plugin collects performance tests results from Apache JMeter. Apache JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to test your server/script/object behavior under heavy concurrent load.
If it is the first time you hear from Apache JMeter then you should try it before using this plugin.
The following metrics are included in Sonar:
- Duration (in seconds)
- Error density (number of errors / number of requests * 100)
- Average response time for requests
- Average response time for transactions
- Successful requests per minute
- Successful requests per minute and user
- Response time deviation for requests
- Response time deviation for transactions
- Number of requests
- Number of transactions
- Successful transactions per minute
- Successful transactions per minute and user
This is an example of the widget you will see in Sonar:
Usage & Installation
JMeter installation is very easy. JMeter is developed with Java and it is distributed as a compressed file.
You can download it from http://jakarta.apache.org/jmeter and then run the provided script (bin/jmeter).
Recording a test in JMeter
You can find a step by step tutorial in JMeter's website: http://jakarta.apache.org/jmeter/usermanual/jmeter_proxy_step_by_step.pdf
It describes how to record a test plan using the JMeter proxy.
You can also take a look at this video tutorial to see how to record a test with JMeter:
SONAR JMeter plugin uses the results datafile generated by JMeter (file with extension .JTL) so remember to configure your test plan to store the results in a single JTL file.
In this video we show you how to set this JTL file:
JMeter Report Server
JMeter Report Server is a server that generates performance reports from JMeter results. SONAR JMeter Plugin uses this server to get the performance metrics from the projects.
It must be installed on the same machine with JMeter tool. The server will read the JTL files to get all the data.
JMeter Report Server Installation
You can easy install your JMeter Report Server from the source code:
This will install JMeter Report Server in $HOME/jmeter-report-server
JMeter Report Server Configuration
JMeter Report Server needs to know where the JTL files are located. You can set this location in the properties file bundled with the server (properties/jmeter-report-server.properties).
where name is the test configuration name that later you will use in SONAR JMeter plugin settings.
Note that you have to specify a "name" for the testconfig jtl path. In the example we have used "iceweb".
Running JMeter Report Server
You can start the server with this command:
And you can stop the server with this command:
SONAR JMeter Plugin
- Copy the jar into /extensions/plugins/ directory
- Restart Sonar server
This video shows how to configure JMeter plugin in SONAR:
- Project must exist in SONAR before using JMeter plugin
- JMeter Report Server must be up and running (local or remote) and it must have a test configuration with the same name you set in SONAR JMeter plugin settings.
- JTL file must exist in the host that is running JMeter Report Server.
Next time you run "mvn sonar:sonar" you will retrieve performance metrics from JMeter and SONAR will show a widget with them.
- SONAR JMeter plugin has dependencies with JMeter Report Client, so if you want to package the plugin you will need to package the JMeter Report Client first, and install it into your maven repository in order to resolve dependencies during plugin compilation and packaging.
Release 0.1 (5 issues)
|SONARPLUGINS-982||Plugin usability: command line parameter for JTL file||Closed||Fixed|
|SONARPLUGINS-956||Code best practices||Closed||Fixed|
|SONARPLUGINS-906||Upload code to SVN||Closed||Fixed|