I have SonarQube 5.1, JMeter plugin installed in SonarQube is 0.3. Maven is: 3.1.0
I have a simple single level Maven project with some tests and JMeter jmx file.
I'm successfully generating the Test results (Unit tests) and JMeter result file (.jtl file in XML format instead of default CSV format). Refer: Sonarqube + Jmeter error in jtl file
Project's pom.xml looks like:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.company.csa.reference</groupId>
<artifactId>csa-reference-app</artifactId>
<version>0.0.17-SNAPSHOT</version>
</parent>
<properties>
<sonar.host.url>http://sandboxserver12.tsh.thomson.com:9000</sonar.host.url>
<sonar.jdbc.url>jdbc:h2:tcp://sandboxserver12.tsh.thomson.com:9092/sonar</sonar.jdbc.url>
<sonar.jdbc.driverClassName>org.h2.Driver</sonar.jdbc.driverClassName>
<sonar.jdbc.username>sonar</sonar.jdbc.username>
<sonar.jdbc.password>sonar</sonar.jdbc.password>
<sonar.junit.reportsPath>target/surefire-reports</sonar.junit.reportsPath>
<sonar.surefire.reportsPath>target/surefire-reports</sonar.surefire.reportsPath>
<sonar.java.junit.reportsPath>target/surefire-reports</sonar.java.junit.reportsPath>
<sonar.java.surefire.reportsPath>target/surefire-reports</sonar.java.surefire.reportsPath>
<sonar.groovy.junit.reportsPath>target/surefire-reports</sonar.groovy.junit.reportsPath>
<sonar.groovy.surefire.reportsPath>target/surefire-reports</sonar.groovy.surefire.reportsPath>
<sonar.language>java</sonar.language>
<sonar.sources>src/main/java</sonar.sources>
<sonar.tests>src/test/java</sonar.tests>
<sonar.binaries>target/classes</sonar.binaries>
<sonar.java.binaries>target/classes</sonar.java.binaries>
<sonar.groovy.binaries>target/classes</sonar.groovy.binaries>
</properties>
<artifactId>a_test_app</artifactId>
<packaging>war</packaging>
<name>a_test_app Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>8.1.15.v20140411</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>8.1.15.v20140411</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>a_test_app</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.7.1</version>
</plugin>
</plugins>
</build>
</project>
When I run mvn sonar:sonar, it works successfully but shows the following lines:
[INFO] [02:35:54.784] Sensor JMeterSensor
[INFO] [02:35:54.784] Sensor JMeterSensor (done) | time=0ms
..
..
[DEBUG] [02:35:57.410] Post-jobs : org.sonar.plugins.jmeter.JMeterPostJob@79854a9e -> org.sonar.plugins.issueassign.notification.SendIssueNotificationsPostJob@3c848bb2 -> org.sonar.plugins.buildbreaker.AlertBreaker@55faaed1 -> org.sonar.plugins.buildbreaker.ForbiddenConfigurationBreaker@295790db
[INFO] [02:35:57.410] Executing post-job class org.sonar.plugins.jmeter.JMeterPostJob
[DEBUG] [02:35:57.411] START JMeterPostJob
[INFO] [02:35:57.411] Getting JMeter results from /path/home/user/giga/csa/a_test_app/target/jmeter/results/CSARefApp.jtl
[DEBUG] [02:35:57.420] getInputStreamByTestConfig for config 'a_test_app Maven Webapp'
[DEBUG] [02:35:57.420] JTL path: /path/home/user/giga/csa/a_test_app/target/jmeter/results/CSARefApp.jtl
[DEBUG] [02:35:57.423] Creating JtlAbstractSampleReader ...
[INFO] [02:35:57.636] Starting global summary report for config 'testapp Maven Webapp'
[DEBUG] [02:35:58.055] JtlAbstractSampleReader read 240 nodes
[INFO] [02:35:58.055] Global summary report successful finished for config 'testapp Maven Webapp'
[DEBUG] [02:35:58.062] JMeter GlobalSummary:
mostUnstableTransBytesOkAvgDevPercent=0.0
mostUnstableTransName=null
mostUnstableTransResponseTimeOkAvgDevPercent=0.0
requestsBytesOkAvg=17003.4375
requestsBytesOkAvgDev=41125.73795246031
requestsBytesOkAvgDevPercent=241.86719863239603
requestsErrorPercent=0.0
requestsErrorTotal=0
requestsOkPerMinute=2452.7337761880426
requestsOkPerMinuteAndUser=122.63668880940213
requestsOkTotal=160
requestsResponseTimeOkAvg=48.5
requestsResponseTimeOkAvgDev=152.453354037334
requestsResponseTimeOkAvgDevPercent=314.33681244811135
requestsTotal=160
slowestTransBytesOkAvgDevPercent=0.0
slowestTransName=null
...
......
..........
transMapResponseTimeOkAvgDevPercent={Transaction_Welcome=57.41068190712635, Transaction_Snoop=56.1112617700907, Transaction_Healthcheck=139.89028322965896, Transaction_Logout=50.02351333561716}
transOkPerMinute=1226.3668880940213
transOkPerMinuteAndUser=61.318344404701065
transOkTotal=80
transOrder=[Transaction_Healthcheck, Transaction_Snoop, Transaction_Welcome, Transaction_Logout]
transResponseTimeOkAvg=97.0
transResponseTimeOkAvgDev=210.29557258321267
transResponseTimeOkAvgDevPercent=216.79955936413677
transTotal=80
usersLogged=20
[DEBUG] [02:35:58.066] END JMeterPostJob
Everything looks good but I'm wondering why it shows the following line even though the .jtl file I have is valid and the Jenkins Performance plugin reports shows valid data/graphs. Why Sonar is ignoring it. I have tried putting the JMeter result .jtl file under both target/jmeter/results and target/jmeter-reports folder but JMeter widget in SonarQube (on the project's dashboard) does NOT show any data like shown below.
[INFO] [02:35:54.784] Sensor JMeterSensor (done) | time=0ms
Is this due to the fact that now JMeter plugin is deprecated http://docs.sonarqube.org/display/PLUG/Deprecated+Plugins?
I don't see the setting anymore in JMeter Plugin section in SonarQube where you can specify your LOCAL jtl file in my SonarQube version.
If I see this matrix, it shows version 0.3 of JMeter plugin in SonarQube is compatible with all available SonarQube versions. See here for JMeter compatibility: http://docs.sonarqube.org/display/PLUG/Plugin+Version+Matrix
Also sonar-plugin in GitHub is 0.5 version https://github.com/SonarCommunity/sonar-jmeter (but not listed in SonarQube Docs site as per their compatibility matrix).
Not sure what I'm missing at this point.