Show aggregate report info in console when running jmeter tests with mvn

Steph

I have a mvn project in which is also integrated jmeter, to test performance. So far I have 6 thread groups in my test plan, all of them contains HTTP Requests. I run the tests using the command "mvn clean verify" from jmeter-maven plugin. Among the results I found multiple rows like this:

summary + 1 in 00:00:02 = 0.6/s Avg: 208 Min: 208 Max: 208 Err: 0 (0.00%) Active: 6 Started: 12 Finished: 6

I would need some extra information in console, especially the name and the avg time of each thread group or of the HTTP Request that ran. For example, something similar with aggregate report from GUI mode :

Label Samples Average Median 90% Line 95% Line 99% Line Min Max ...

AppleCodeRequest 6 196 119 279 284 284 108 284
PearCodeRequest 3 382 485 490 490 490 173 490

I want this because I am using a sh script to run the tests and I would like to trigger some performance issues before opening the html reports.

Is there any way to obtain this? Maby some user properties (even if I searched for one and no result) or some workaround ?

Dmitri T

The easiest solution is going for a plugin like BlazeMeter Uploader, this way you will be able to observe real time test metrics in a fancy web UI. You can install BlazeMeter Uploader plugin using JMeter Plugins Manager

enter image description here


Alternative solution would be using JMeterPluginsCMD Command Line Tool.

  1. Add the next lines to your pom.xml file

    <configuration>
        <jmeterExtensions>
            <artifact>kg.apc:jmeter-plugins-cmd:2.2</artifact>
            <artifact>kg.apc:jmeter-plugins-synthesis:2.2</artifact>
            <artifact>kg.apc:jmeter-plugins-dummy:0.2</artifact>
            <artifact>kg.apc:cmdrunner:2.0</artifact>
            <artifact>kg.apc:jmeter-plugins-filterresults:2.2</artifact>
            <artifact>kg.apc:jmeter-plugins-cmn-jmeter:0.6</artifact>
        </jmeterExtensions>
        <!-- The plugin uses some broken dependencies
             An alternative is to set this to true and use excludedArtifacts, see below
        -->
        <downloadExtensionDependencies>false</downloadExtensionDependencies>
        <propertiesJMeter>
            <jmeter.save.saveservice.autoflush>true</jmeter.save.saveservice.autoflush>
        </propertiesJMeter>
    </configuration>
    
  2. Add another Thread Group to your Test Plan with 1 user and infinite number of loops

  3. Add JSR223 Sampler to your Thread Group
  4. Put the following code into "Script" area:

    SampleResult.setIgnore()
    def resultFile = new File('../results').list().first()
    "java -jar ../lib/ext/cmdrunner-2.0.jar --tool Reporter --generate-csv temp.csv  --input-jtl ../results/$resultFile --plugin-type AggregateReport".execute().waitFor()
    println("cat temp.csv".execute().text)
    new File("temp.csv").delete()
    
  5. Control how frequently you want to see this info using i.e. Constant Timer
  6. You should be able to see the results in the console window:

    enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

ClassNotFoundException when running mvn exec:java on Windows

Jmeter NullPointerException when running the GUI

How to improve console output when running tests?

Show Gradle Console when running task

Can I Include requests with cached responses in JMeter Aggregate Report

How to calculate samples of JMeter aggregate report

Laravel: Disable Artisan console output when running tests

How do I make the performance trend visible/available on Jenkins when using jmeter-maven-plugin for running the jmeter tests?

Error when running mvn archetype:generate

console log does not show info logs anymore

How to see output of `console.log` when running Jasmine tests

JMeter 5.0 / "JMeterUtils: ERROR! Resource string not found" @ Aggregate Report

Google tests don't show report messages

mvn test command not running tests in a Spring Boot project

Running JMeter report genaration on Mac

Is Console.SetOut wise to use when running tests in parallel?

jmeter -How to set max value in Aggregate report

Get Image info and show in console on page resize

Throughput calculation in jmeter with respect to aggregate report

Jmeter Tests work at the console, but not with the JMeter Jenkins(Performance) plugin

Tests are not running correctly with Nunit 3 console

How can I change the color of [INFO] in the console when running Tomcat in IntelliJ?

Jmeter cyclic running tests

How to show Request data in Summary report and HTML dashboard report in JMeter

How to make the performance trend visible/available with jenkins pipeline on Jenkins when using jmeter-maven-plugin for running the jmeter tests?

JMeter: Transaction Controller label name is not displaying in aggregate report

Running mvn on Cucumber Project Doesn't Run Any Tests

What is the relationship between the 99% Line and throughput in Jmeter's Aggregate Report

How do I exclude certain junit tests when running 'mvn test'