how to filter jmeter dashboard that generated using maven project - jmeter

I am generating a dashboard using jmeter, and I want to restrict warmup requests like (sampler names) setPost, setGet, setPut, and setDelete from showing up in the dashboard. But, these have to be run before running other requests.
I tried to use:
jmeter.reportgenerator.exporter.html.series_filter=[^setPost]|[^setGet]|[^setPut]|[^setDelete]
in the reportgenerator.properties file, but I had no luck.

In JMeter use Menu
Help > Export Transactions for report
Remove what you don't want.
Finally copy this to user.properties, read this for more details.
For maven, see this so set in pom.xml :
<configuration>
<propertiesJMeter>
<jmeter.reportgenerator.exporter.html.series_filter>^(Java Request)(-success|-failure)?$</jmeter.reportgenerator.exporter.html.series_filter>
</propertiesJMeter>
</configuration>

Related

Build passes but seems JMeter test is not running through Maven CMD command

I am trying to execute my JMeter scripts through Maven. I am using Jmeter 5.3 and I am using below pom.xml.
When I execute it through command prompt mvn verify -Dusers=1 -DrampUp=1 -Dloopcount=1 -Durl=1 -DSmokeDemoTest=1, it shows me the build success message but seems it is not executing my JMeter test script that's why I am not getting JTL report file in target folder. I am attaching command prompt execution screenshot. Could you please suggest and help me out on this issue.
POMXML:
CommandPromptExecution Image:
Your test is running fine, the only problem is that there are 0 samplers executed therefore there are no results.
From your very beautiful screenshot of the pom.xml file it's not very clear how do you define the users property, you should have something like:
<properties>
<users>1</users>
<rampUp>1</rampUp>
<loopcount>1</loopcount>
<url>http://example.com</url>
<suite>foo</suite>
</properties>
in the beginning of your pom.xml file.
Once done the properties will be declared and you will be able to override them via -D command-line argument.
Also make sure to properly reference the properties in JMeter test plan using __P() function
If you will still be experiencing problems check the jmeter.log file(s) under target/jmeter/logs folder for any suspicious entries
More information:
How to create user defined properties in Maven
How to Use the JMeter Maven Plugin

How do I disable JMeter reporting in non-gui mode

Is there a way to completly disable Jmeter reporting in non-gui mode?
so it does not create any html reports?
It is disabled by default so nothing to do.
It is enabled by :
-e -o outputfolder
-g csvfile - o outputfolder
From your comment, you may be adding one of the options above which trigger report generation.
It seems you're using JMeter Maven Plugin, in this case, use version 2.8.6 and set as per wiki:
<configuration>
<resultsFileFormat>xml</resultsFileFormat>
<generateReports>false</generateReports>
</configuration>
This tutorial can help you using this maven plugin.

UnknownHostException Error in HTML report

I am trying to generate HTML report using one of the Jmeter test script. I have a JMX file which works fine in Jmeter and Jmeter provide success status when I run the script. I have setup ANT with Jmeter successfully. Now, I am trying to generate HTML report using ANT from command prompt. when I run this command ant -Dtest=script name, it generate HTML report in the same folder.. But all the items in the HTML reports shows error.
Please help.
check your version of the Jmeter if its 3.0 it might not work. As Jmeter devs broke this functionality. Now to get it to working all you have to do is copy
jmeter-results-detail-report_21.xsl from Jmeter 2.13 extras folder to Jmeter 3.0 extras
And update Build.xml in extras folder to reflect this change
<tstamp><format property="report.datestamp" pattern="yyyy/MM/dd HH:mm"/></tstamp>
<xslt
classpathref="xslt.classpath"
force="true"
in="${basedir}/${test}.jtl"
out="${basedir}/Test.html"
**style="${basedir}/jmeter-results-detail-report_21.xsl">**
<param name="showData" expression="${show-data}"/>
<param name="titleReport" expression="${report.title}"/>
<param name="dateReport" expression="${report.datestamp}"/>
</xslt>
</target>

How can I specify path to jtl files when I want to publish graph (from jmeter-graph-maven-plugin) in teamcity?

I use jmeter-maven-plugin (version 1.10.0) to run JMeter test - first I run it from IntelliJ, then from TeamCity (for both - command: mvn jmeter-graph:create-graph)
When I want to use the following configuration for jmeter-graph-maven-plugin:
<plugin>
<groupId>de.codecentric</groupId>
<artifactId>jmeter-graph-maven-plugin</artifactId>
<version>0.1.0</version>
<configuration>
<inputFile>${project.build.directory}/jmeter/results/*.jtl</inputFile>
<graphs>
<graph>
<pluginType>TransactionsPerSecond</pluginType>
<outputFile>${project.build.directory}/jmeter/results/TPS.png</outputFile>
</graph>
</graphs>
</configuration>
</plugin>
it works from IntelliJ, but in TeamCity I get:
ERROR: java.lang.IllegalArgumentException: Cannot find specified JTL file: /project/XX/opt/team-city-8.0.5/buildAgent/work/xxxxx/JMeter/target/jmeter/results/*.jtl
Result file exists (and it is previous used in xml-maven-plugin - even configuration is *.jtl - xml plugin works correctly in TeamCity).
When I use specific file name (so e.g. 20150317test-result.jtl instead of *.jtl) it works also from TeamCity.
How can I use general file name? Or maybe there is an option in jmeter-maven-plugin to define some fixed jtl file name (and then use it in jmeter-graph-maven-plugin)?
I did workaround for this issue.
I changed jmeter-graph-maven-plugin configuration to:
<inputFile>${project.build.directory}/jmeter/results/${fileName}.jtl</inputFile>
and now I run it using mvn jmeter-graph:create-graph -DfileName=%profile% (where profile name is the same as jmx test file).

What maven plugin is to be used for JMeter? jmeter-maven-plugin or chronos-jmeter-maven-plugin?

I need to setup performance tests which are run automatically triggered by a CI system. For that I want to use JMeter due to some scripts and experience already exist and I want to combine it with Maven.
During my research for a reasonable plugin I found that two plugins are existing:
jmeter-maven-plugin:
http://wiki.apache.org/jmeter/JMeterMavenPlugin
chronos-jmeter-maven-plugin:
http://mojo.codehaus.org/chronos/chronos-jmeter-maven-plugin/usage.html
Which one is better to be used? Both seem to be currently maintained and under development. Is there any experience on this? Even the configuration is similar.
I would be happy to get some hints to help me descide without playing around with both plugins for some days.
I haven't yet used the .jmx files with maven and specifically those plugins you mention.
But I can think of a way how to do it if I needed that.
So consider this, you can execute jmeter test in no gui mode.
Create a shell script wrapper that will execute the jmeter test in no gui mode, example (jmeter_exe.sh):
$JMETER_HOME/bin/jmeter.sh -n -t MY_LOAD_TEST.jmx -l resultFile.jtl
So this will execute the given script and store results in the .jtl file, you can use that to display your test results maybe this post will be useful to you, it's off topic for now.
With step one done.
2.You could then create directory scripts in your project root. Than you can put this in your pom.xml :
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<id>Run load Test</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${basedir}/scripts/jmeter_exe.sh</executable>
</configuration>
</execution>
</executions>
</plugin>
And voila your test is executed during generate-sources phase. This might have been easier with the plugins you mentioned but I have no knowledge of those, this is what just came to my mind.
Use jmeter-maven-plugin: http://wiki.apache.org/jmeter/JMeterMavenPlugin.
It's the de-facto one and (as #Ardesco mentioned above) it doesn't require anything to be installed, which gives you abstraction on where JMeter executable is installed and all those kind of problems...
Word(s) of warning on the apache plugin (lazerycode):
It suppresses JMeter output by default, add the following configuration settings to prevent that:
<configuration>
<suppressJMeterOutput>false</suppressJMeterOutput>
<!-- to override debug logging from the plugin (although also in jmeter.properties) -->
<overrideRootLogLevel>debug</overrideRootLogLevel>
<jmeterLogLevel>DEBUG</jmeterLogLevel>
</configuration>
Looking at the source (of version 1.8.1), it seems the -Xms and Xmx are limited to 512
The plugin swallows exceptions so your tests may fail but you don't know why. It looks like they've just completed but not provided results.
The jmeter mojo kicks off jmeter as a new java process but does not provide the capacity to provide any arguments to this execution. So if exceptions are swallowed (See above), and logging isn't sufficient (which it may not be) it's not easy to debug the process to fing out what's wrong. We (my colleague) added the debug args to the process execution and debugged the jmeter call to find out.
you get informative output running jmeter directly for dev purposes. I'd say it's even more informative in the jmeter UI output.
I've not used chronos mind.
JMeter Maven Plugin by #Ardesco is updated every time JMeter version is released.
It is very well documented and works perfectly.
It is easily setup and allow easy addition of plugins like JMeter-Plugins or commercial plugins as long as required libraries.
You can read a full blog showing the setup for old version 1.1.10:
http://www.ubik-ingenierie.com/blog/integrate-load-testing-in-build-process-with-jmeter-ubikloadpack-maven/
For more recent version 2.5.1 (as of November 2017) ensure you read documentation:
https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki

Resources