How do I disable JMeter reporting in non-gui mode - jmeter

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.

Related

How can I debug my tests in Open Liberty server dev mode (using liberty-maven-plugin) and toggle the debugger on/off?

SUMMARY
How can I iteratively run my unit/integration tests in "dev mode" of the liberty-maven-plugin and easily turn on and off the launching of the debugger into the JVM running the tests themselves?
BACKGROUND
While the liberty-maven-plugin by default starts the Open Liberty server in debug mode, sometimes you need to debug into the source of the unit/integration tests themselves. The liberty-maven-plugin dev mode launches the server and will (by default) run my tests each time I hit <Enter>.
I can leverage standard documented approaches, which by default will launch a forked JVM waiting for a debugger on port 5005, e.g.:
mvn -Dmaven.failsafe.debug liberty:dev
But what if I already started dev mode without that property set on the command line?
Is there an easy way to enable the debugger after the fact? Or to toggle it on/off across executions?
An easy way to "toggle" the debug mode for the tests is to use Maven project properties and dynamically comment/uncomment out the standard test debug properties, e.g. maven.failsafe.debug.
E.g this will launch ITs in a forked JVM, suspended and waiting for the debugger on port 5005:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.failsafe.debug>true</maven.failsafe.debug>
<!--
<maven.surefire.debug>true</maven.surefire.debug>
-->
</properties>
You can also configure the maven-failsafe-plugin in your pom.xml with normal plugin configuration to configure non-default behavior.
This should work with recent (since v3.1) versions of the liberty-maven-plugin, e.g.:
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.3.3</version>
</plugin>
This could be applied to a simple sample app like the one here:
https://openliberty.io/guides/getting-started.html
WARNING
Don't make the mistake of toggling the value to "false" since you're really configuring this parameter. Just comment it out completely to avoid suspending for the debugger.

how to filter jmeter dashboard that generated using maven project

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>

How can I debug with the Cloud-SDK-based Maven App Engine plugin?

I'd like to debug with the Cloud-SDK Based Maven plugin (com.google.cloud.tools::appengine-maven-plugin v. 1.3.0).
I run the goal appengine:run in Eclipse in Debug, but this does not put me into Debug mode, e.g. stopping on breakpoints.
I can use remote-debugger, but it is a hassle to run two processes every time I need to start my application. Is there a way of running a Debug session with one command?
I believe the only way to do this with Maven is by setting up a remote debug configuration in Eclipse as described in the App Engine documentation.
<configuration>
<jvmFlags>
<jvmFlag>-Xdebug</jvmFlag>
<jvmFlag>-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</jvmFlag>
</jvmFlag>
</configuration>
Your eclipse remote debug configuration needs to use the port specified in the jvmFlag arguments.
Another more practical way to run the debugger is to use Google Cloud Tools for Eclipse.

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