Jenkins display multiple JMeter report(.jtl) in single graph - jenkins

In Jenkins, I have configured multiple JMeter scripts using maven-jmeter-plugin in single job. After execution, each JMeter script is generating its own report file(.jtl) in results folder.
I have also configured the Performance plugin of Jenkins to display the report after JMeter script execution.
My problem is, the Performance plugin is showing different graph for each .jtl file.
Current Graph
I need to report to be shown in single graph.
Expected Graph
Is there any plugin available to achieve the same?
if no, how can I update the current plugin to achieve merged graph?

There is Merge Results plugin which can be used for combining/comparing results of up to 4 different JMeter tests.
You can install the plugin using JMeter Plugins Manager
Merge Results tool can also be used in command-line
Amend merge-results.properties (by default it's located in "bin" folder of your JMeter installation), make sure it contains these lines:
inputJtl1=TestResult_1.jtl
inputJtl2=TestResult_2.jtl
Execute Merge Results using JMeter Plugins Command Line Tool like:
JMeterPluginsCMD --tool Reporter --generate-csv CombinedResult.jtl --input-jtl merge-results.properties --plugin-type MergeResults
Configure Jenkins Performance Plugin to read CombinedResult.jtl file instead of your 2 files.

Related

How can I create multiple performance test result reports on Jenkins?

I have a small problem about JMeter integration with Jenkins and I hope you can solve it. Let me explain it;
I have 3 different jmx (JMeter) files. I can run it via Windows bash command and I successfully create jtl log file for Performance plugin on Jenkins. Windows bash command is this for one of them;
cd C:\apache-jmeter-4.0\bin\ && jmeter -Jjmeter.save.saveservice.output_format=xml -n -t C:\apache-jmeter-4.0\load_tests\testrun.jmx -l C:\apache-jmeter-4.0\load_tests\logs\testrun.jtl
However, Performance plugin allows only one performance test result. I want separate graphics and reports for each test file. When add "Publish performance test result report" and type "C:\apache-jmeter-4.0\load_tests\logs\*.jtl", it combines all result. As I said I need separate test result reports.
I havent used it much with Jenkins.
But, if it allows for 1 then you can create 3 jenkin plans and execute them and all will get their individual report. Until, you have some specific dependencies between the 3 jmx plans.
Jenkins performance plugin states
If you just have one report file, the graph of this reports will appear on the main page.
If you have more than one report file, you have to click on “Performance Trend” and the graphs will appear.
So more than one report file is possible.
I found the solution. My Jenkins version is not compatible with JMeter 4.0 that's why I use JMeter 3.3 and it works perfectly. Thanks for all your answers.

How to check the pmd results in Jenkins?

Have a Java project and just automated it's build process using Jenkins Here is my console output of Jenkin console
18:50:22 Started by user suresh
18:50:22 Building in workspace C:\Program Files (x86)\Jenkins\workspace\pmdtest
18:50:23 [PMD] Collecting PMD analysis files...
18:50:23 [PMD] Finding all files that match the pattern **/pmd.xml
18:50:23 [PMD] Computing warning deltas based on reference build #6
18:50:23 Finished: SUCCESS
I can see that there are messages related to PMD.
May be I need to give something in the below configuration ? above output is when the below box (in image) is empty. Want to PMD all the js files. So tried
However, I do not know how to check the generated report? Is there any location that I have to go and check the results ?
What exactly needs to give there? May be that solves the other problem ?
The Jenkins PMD Plugin doesn't do any analysis, this must be done by the maven pmd plugin. The Jenkins plugin can just display the results.
Try to add the goal pmd:pmd to your maven command, this will generate a result file target/pmd.xml which you need to add to the config (PMD results).

Search for a module in all Jenkins jobs

Is it somehow possible so search for a module within all Jenkins jobs?
Let's say there's the module common-messaging. It's built in Job 1 and Job 2.
When I search for the module name I want both jobs to be shown.
Jenkins store the jobs configuration on disk in XML files. So you can grep the file for whatever XML element is created by the plugin.
create a new job that just have that plugin enabled.
get the XML file: /ci/job/name_of_your_job/config.xml
look for an XML element that correspond to common-messaging, lets say common-messaging.plugin
Then if using a UNIX system:
grep common-messaging.plugin /var/lib/jenkins/jobs/*/config.xml
Windows must have a similar command.
If you have admin access to the server, install the Scriptler plugin (which gives you more easy access to the Groovy console), and fetch and run this shared Scriptler snippet: http://scriptlerweb.appspot.com/script/show/486001

Reusing several report files in jenkins sonar plugin

I'm generating several XML report files via ant task (checkstyle, findbugs, macker, jacoco, ncss, classycle, etc.).
I want the to reuse the generated files in jenkins sonar plugin. Is there any way to do so?
I'm planning in setting the properties in the project specific sonar-project.properties file. But I can't find any of these options at codehaus documentation site.
There's no point to reuse:
checkstyle or findbugs reports as SonarQube also executes those tools
ncss or classycle reports as it is SonarQube very job to compute those metrics
For JaCoCo, you can reuse reports if you don't want SonarQube to execute the unit tests again. See http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Unit+Tests+for+Java+Project.

Multiple jMeter scripts for Jenkins?

I'm interested is it possible using Jenkins+Performance plugin to run more than one .jmx (jMeter) files.
I'm using SVN repository where I keep my jMeter scripts. But problem is I can add only one jmx file to repo. I want add more than one, but Jenkins runs only first one.
I think you can use Ant to do this in Jenkins.
Note the "testplans" element in the following build.xml snippet:
<jmeter>
jmeterhome="c:\jakarta-jmeter-1.8.1"
resultlog="${basedir}/loadtests/JMeterResults.jtl">
<testplans dir="${basedir}/loadtests" includes="*.jmx"/>
</jmeter>
More info here: http://www.programmerplanet.org/projects/jmeter-ant-task/

Resources