Auto tune jvm in taurus container - jmeter

You can set a jvm memory settings and Taurus but does it support Dynamic tuning at all? Is there a setting to tune the jvm relative to the number of CPUs and memory available on the system? It would be nice not to have to script this myself.
Especially if I'm running the Taurus container and I want it to be portable.

You can get the amount of free RAM (in gigabytes) like:
grep MemTotal /proc/meminfo | awk '{print $2}' | xargs -I {} echo "scale=4; {}/1024^2" | bc
You can set JMeter JVM memory limit in Taurus config file like:
modules:
jmeter:
memory-xmx: 4G
You can combine points 1 and 2 via Taurus Dockerfile to write the aforementioned lines somewhere to /etc/bzt.d/ folder where default Taurus configuration lives.
See How to Execute a Load Test Using the Taurus Docker Image guide for more information

Related

How to set thread count for remote servers in command-line mode

I am using the following command for distributed load testing in JMeter:
jmeter -JThreadCount="5" -n -t "path.jmx" -R IP1,IP2 -l "path.csv" -e -o "outputpath"
But it does not take 5 as the thread count but runs 2 times one for each remote system. When I remove the -R parameter it takes 5 as the thread count.
How to pass the ThreadCount (variables) to the remote servers?
I do believe that you need to use -G command-line argument in order to pass the
property to the remove slaves
I don't think you need these quotation marks around 5
Suggested amended command line:
jmeter -GThreadCount=5 -n -t "path.jmx" -R IP1,IP2 -l "path.csv" -e -o "outputpath"
More information:
Full list of JMeter command-line options
Overriding Properties Via The Command Line
How to Perform Distributed Testing in JMeter

How can i create HTML report in JMeter using Bean shell sampler in tear down thread?

I want to create an HTML report automatically after running each test in JMeter, also I want to create a folder dynamically with the current timestamp as a folder name for placing the report on my local drive. So how can we do this operation using Bean Shell sampler in tear down thread group?
Your approach is not very good as it violates 2 major JMeter Best Practices:
You will need a Listener in order to write down the results and using Listeners is a performance anti-pattern
Since JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language for scripting
So I would recommend:
Run your JMeter test in non-GUI mode and generate dashboard after it
Use your operating system date and time command to create the folder with the timestamp
Windows example:
jmeter -f -n -t test.jmx -l result.jtl -e -o results-%date:~10,4%-%date:~4,2%-%date:~7,2%
Linux example:
jmeter -f -n -t test.jmx -l result.jtl -e -o results-`date +%Y-%m-%d`

HTML Report in JMeter 5.1 after distributed execution not being generated correctly

The current setup is as follows: 4 Ubuntu boxes one master and 3 slaves. I've been encountering the following issues when executing the tests from command-line in distributed fashion.
If I execute the tests and try to generate the HTML report, JMeter attempts to create the files after each of the machines finish their runs, this causes conflicts as the first machine that finished had already created the HTML folder.
./jmeter -r -n -t ./Jmeter_Performance_PoC.jmx -l ./TestResults.csv -e -o TestResults
If I execute the tests and just generate the CSV report to then generate the HTML report from the CSV file, the report gets generated, but JMeter is not using the files full information, it is not identifying the different thread groups nor is it displaying the execution information per slave.
./jmeter -r -n -t ./Jmeter_Performance_PoC.jmx -l ./TestResults.csv
./jmeter -g ./TestResults.csv -o ./results
Is there a way of having JMeter generate the consolidated report in distributed execution without having override conflicts?
Just use __machineIP() or __machineName() as a prefix or postfix for the Thread Groups / Samplers labels - this way you (and JMeter) will be able to distinguish the results coming from the different slaves.
Check out Apache JMeter Functions - An Introduction to get familiarized with the JMeter Functions concept.

How to run jmeter jmx files parallely from single command prompt

I have 5 different jmx files in my project. I need to do performance testing by running all these jmx files parallely. Currently i'm opening 5 different jmeter command prompt instance and triggering the execution.
Is there any way i can execute all these jmx files from 1 jmeter command prompt?
Depending on your operating system the options are in:
Linux: there is a parallel command, you can go for something like:
parallel --gnu << 'EOF'
jmeter -n -t test1.jmx -l result1.jtl
jmeter -n -t test1.jmx -l result2.jtl
etc.
EOF
Windows: you can create a batch script assuming start command something like:
start jmeter -n -t test1.jmx -l result1.jtl
start jmeter -n -t test2.jmx -l result2.jtl
etc.
As a cross-platform unified solution you can consider using Taurus tool as a wrapper for your JMeter script you can kick off multiple JMeter tests in parallel using simple declarative YAML syntax like:
---
execution:
- scenario:
script: test1.jmx
- scenario:
script: test2.jmx
- scenario:
script: test3.jmx
#etc
See Taurus - Working with Multiple JMeter Tests for more details.
You need to use some other tools like Ant or Maven or jenkins for that.
Please check the below link for more information:-
How to run multiple jmx scripts together in JMeter
Praveen, I don't think this is currently possible in JMeter to execute multiple .jmx files from single command , but I would suggest adding all 5 scripts in a single .jmx file if possible in your scenario.

Throughput Shaping timer- Externalising

I want to externalise the value for throughput shaping timer But not from Jmeter or User.properties as I have couple of other script to be executed with different work load model. I want a separate property file specifying the load pattern can you kindly suggest.
There is a load_profile property, you can define the desired Throughput Shaping Timer load model via it.
If you don't want to write down the value into jmeter.properties or user.properties file to permanently change the profile you can pass it via -J command line argument instead like:
jmeter -Jload_profile=const(10,10s) line(10,100,1m) step(5,25,5,1h) -n -t ...
Having separate file is also not a problem,
Create, i.e. test1.properties file in the "bin" folder of your JMeter installation
Put your desired load profile there:
load_profile=const(10,10s) line(10,100,1m) step(5,25,5,1h)
Pass this file to JMeter via -q command-line argument like:
jmeter -q test1.properties -n -t ...
Repeat steps 1-3 for 2nd test, you will be able to run it like:
jmeter -q test2.properties -n -t ...
References:
Full list of JMeter's command-line options
Configuring JMeter
Apache JMeter Properties Customization Guide

Resources