...
Plugin | 0.1 | 0.2 |
|---|---|---|
Sonar | 2.4+ | 2.4+ |
Quick guide
- Install plugin in SONAR (copy to extensions/plugins/) and restart SONAR server.
| Info |
|---|
New feature in plugin version 0.2 |
If you want to use JMeter Report Server then:
- Download jmeter-report-server-0.2-jar-with-dependencies.jar
- Run server where your JMeter instance is running:
Code Block > java -Dtestconfig.name.jtlpath=/path/to/file.jtl -jar jmeter-report-server.jar - Go to your system settings in SONAR and set host and port for your JMeter Report Server.
- Go to your project settings and set the "configuration key" (this must be the same you set in your property name).
- Run mvn sonar:sonar
- Add JMeter widget to your dashboard and your JMeter metrics will be shown

| Info |
|---|
JTL files must be provided as a result of JMeter tests. |
...
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:
...
| Widget Connector | ||
|---|---|---|
|
- Project must exist in SONAR before using JMeter plugin
- JMeter Report Server must be up and running if using remote configuration, 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.
Since 0.2 version, there is a jmeter-report-server embedded inside the sonar plugin, and there is a new configuration option (Local jtl file) where you can set a jtl file path, local to the sonar server. If this option is set, no remote jmeter report server if used, and jmeter test results are taken from the local file.
...
You have to configure your project to be able to do that:
- Include your jmeter.properties and all your JMeter tests in "src/test/jmeter"
- Configure your new maven plugins in your project and set "jmeter-reports" as the your report directory.
| Code Block |
|---|
<!-- Plugin to launch your JMeter tests in Maven -->
<plugin>
<groupId>org.apache.jmeter</groupId>
<artifactId>maven-jmeter-plugin</artifactId>
<version>1.0-GA</version>
<configuration>
<reportDir>${project.build.directory}/jmeter-reports</reportDir>
</configuration>
</plugin>
<!-- Plugin to start a container and be able to run your webapp and perform your JMeter tests
This example uses Tomcat 7 as the container. -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.1.0</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<zipUrlInstaller>
<url>http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.12/bin/apache-cat-7.0.12.zip</url>
</zipUrlInstaller>
</container>
</configuration>
</plugin>
|
To get sonar-jmeter-plugin working in maven side, there must not be any configuration values set in Sonar (all of them must be blank).
Known limitations
- You can only use one JTL file per project.
Changelog
| JIRA Issues | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...

