Jmeter cmdrunner observed garbage characters - linux

Please need some advise how to resolve this characters, thanks.
command:
java -jar apache-jmeter-4.0/lib/cmdrunner-2.2.jar --tool Reporter --generate-png tps_L1.png --input-jtl jmeter.jtl --plugin-type TransactionsPerSecond --width 1024 --height 768
Environment:
CentOS v7.3
Jmeter v4.0

It might be caused by your test using non-ASCII characters for Thread Group(s) and Sampler(s) labels.
First of all double check JMeter doesn't have problems with storing/interpreting Thread Group and Sampler labels, i.e. try generating HTML Reporting Dashboard (it includes Transactions per Second chart by the way)
If the problem remains - you need to find a way to configure JMeter to handle national characters, i.e. try explicitly defining file.encoding property to be UTF-8. To do this add the next line to system.properties file (lives in "bin" folder of your JMeter installation)
file.encoding=UTF-8
and restart JMeter to pick the property up
If it helps - play the same trick with JMeter Plugins CMDRunner tool, like:
java -Dfile.encoding=UTF-8 -jar apache-jmeter-4.0/lib/cmdrunner-2.2.jar --tool Reporter --generate-png tps_L1.png --input-jtl jmeter.jtl --plugin-type TransactionsPerSecond --width 1024 --height 768
Also be aware that according to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.0 (or whatever the latest version is available at JMeter Downloads page) as soon as possible

Related

Linux Capabilities: CAP_SYS_NICE=ep results in AttachNotSupportedException on JDK11+

Currently running on a fedora machine with JDK 11.0.15, and java capabilities set to "cap_sys_nice+ep".
The command that I am testing is "jcmd JFR.start ....". However, I end up getting the error,
AttachNotSupportedException. Unable to open socket file tmp/attach_pid1234: "
"target process 1234 doesn't respond within 10000 ms"
Process 1234 was launched via JDK11.0.15 java with the CAP_SYS_NICE capability set.
However, when I attempt to do a Java Flight Recording, I always get the error above. jcmd does not have any capabilities set.
What really puzzles me is the fact that, given the same process run using JDK11.0.15, if I utilize jcmd from JDK8 or JDK7, everything works fine.
The only solution I have found is by giving JDK11.0.15 jcmd CAP_SYS_PTRACE=ep capabilities. Could anyone explain what exactly is going on in the background? Thanks.

How to change log.info/error message's font color in Jmeter's JSR223?

I'm trying to find a way to change log.info/error message's font color so that it would be easier for me to read messages in Jmeter's JSR223 Log section
any advice ?
thanks,
As per current version (JMeter 4.0) I don't think it is possible. You can use Groovy Coloriser library if you want, however it will only work for println statements, not for JMeter's log.error
The only way you can filter out the log output to errors only is configuring JMeter logging subsystem to display only messages of ERROR level (or above). You can do this in at least 2 ways:
Locate <Root level="info"> line in log4j2.xml file (lives in "bin" folder of your JMeter installation) and change info to error. JMeter restart will be required to pick the property up
Or you can simply run JMeter like jmeter -LERROR
In both cases you will not be seeing all these INFO and/or WARN messages anymore, you will see only ERROR and above.
More information:
Overriding Properties Via The Command Line
How to Configure JMeter Logging

Absolute path not shown properly in Jmeter with WDS

For a scenario, I am using Jmeter with WebDriver Sampler. So for uploading a file, since I need to run in Jenkins, I have to pass the absolute path of file. To get the current path I defined following command in User Defined variable.
${__groovy(import org.apache.jmeter.services.FileServer; FileServer.getFileServer().getBaseDir();)}${__groovy(File.separator)}
When I log this its working fine. Its showing the file path correctly. But when I use this in WDS and try to log. I am getting the file path with all the backslash removed and unnecessary spaces.
C:\ram\file\part1\renamed.txt
It has to be printed like this, but instead
cramfilepartrename d
It prints like this. Any idea what can be the issue ?
I cannot reproduce your problem using latest versions of JMeter and WebDriver Sampler:
Make sure to upgrade to JMeter 4.0 (or whatever is the latest version available at downloads page)
Make sure to upgrade WebDriver Sampler plugin to version 2.3 using JMeter Plugins Manager
Make sure to use WDS.log shorthand to print the variable value

Puppet Development Kit test unit with multiple output targets

We have introduced the PDK lately into our developments chain and are now trying to make everybody happy with the test outputs it generates.
We need an output as JUnit test report for our jenkins jobs. That we have solved.
And we need the output still on the console because some of the developers find it very annoying having to open the JUnit report file before they can see failed tests.
pdk test unit --format=junit:report.xml
Is how we configured the output for JUnit.
Unfortunately as soon as you configure the JUnit report no output gets printed on the console/stdout anymore. Even if you add another format like --format=text without target file.
Is there a way to achieve both without running the PDK twice?
It doesn't appear to be in the docs, but this should work.
pdk test unit --format=junit:report.xml --format=text:stdout
See https://github.com/puppetlabs/pdk/blob/7b2950bc5fb2e88ead7321c82414459540949eb1/lib/pdk/cli/util/option_normalizer.rb#L10-L24
I've filed a ticket to ensure that gets promoted to the docs at https://puppet.com/docs/pdk/1.x/pdk_reference.html#pdk-test-unit-command
From PDK documentation
--format=[:]
Specifies the format of the output. Optionally, you can specify a target file
for the given output format,
such as --format=junit:report.xml . Multiple --format options can be
specified as long as they all have distinct output targets
So I believe ,you can try as below
pdk test unit --tests=testcase_name --format=junit:report.xml --format=text:log.txt
Hope it helps.

JMeter howto: same thread group - same variable - different value

I'm doing a performance test on different versions of my application.
The results end up in a csv summary-report.
Is there a way to change the variable correctly for each thread group?
Manual Script:
Script with variable: (not working, help needed).
I don't want to change the version manually when a version changes, but only one parameter. Thanks!
Try using _P or _property function in your Thread Group and Sampler names.
Like Application-${__P(version1,)}, Login-${__P(version1,)}, etc.
Provide property value via 'user.properties' file or via -J command-line argument as
jmeter -Jversion1=1.0 -Jversion2=2.0 -n -t path_to_your_script.jmx -l path_to_results.jtl
All generated reports will contain these properties.
References:
How do I run JMeter in non-gui mode
Apache JMeter Properties Customization Guide

Resources