Read system property from a target server for JMeter GUI tests - jmeter

I'm running tests on JMeter on a target server. So I start JMeter(GUI) on my Mac but it points to a Linux server and runs tests against it. I need to read a system property on the target server and use that in my If Controller.
System.getProperty("prop_name"); works if the property is defined on my mac. But it doesn't pick it up from the target server.
Any suggestion is much appreciated!
Thanks!

I can suggest 2 options:
If your application under test has JMX enabled - you can read the "interesting" property value in one of JSR223 Test Elements using Groovy code. The properties can be queried from the RuntimeMXBean.
See Java Management Extensions (JMX) Technology Tutorial for more information.
If there is no JMX exposed to the outer world you can still try to get the property value remotely. Be aware that you can run any command or program on remote Linux instance using SSH Sampler. SSH Sampler can be installed using JMeter Plugins Manager.
See How to Run External Commands and Programs Locally and Remotely from JMeter for more information.

Related

I need help for jmeter

When I execute ApacheJmeter then UI is coming blank.Please help me how I can get user interface of jmeter.I also installed java development kit v 17.0.3.
Check jmeter.log file for any suspicious entries. If it doesn't contain anything meaningful - increase JMeter logging verbosity to DEBUG level
Try earlier version of Java, the minimum you can run JMeter 5.4.3 with is Java 8
Try nightly build of JMeter
Try another look and feel, i.e. run JMeter as:
jmeter -Jjmeter.laf=CrossPlatform

JMeter Non gui mode doesnot show stats for the script, but it does work for rest other scripts

While running the script in non-gui mode for jmeter tests, test gets completed but it does shows min: 0, max: 0...
note:
JMeter 5.4 is installed without any 3rd party plugin.
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
Please help
It means that none of Samplers were executed and the reasons could be in:
The number of threads in Thread Group is 0
The test contains CSV Data Set Config and the .csv file is not there
The test relies on a JMeter Plugin which is not installed
etc.
The reason should be in jmeter.log file, check it and I believe you will find either the cause or at least a clue there.
Also be aware that according to 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article you should always be using the latest version of JMeter so consider upgrading to JMeter 5.4.1 (or whatever is the latest stable version available at JMeter Downloads page) on next available opportunity
I guess you probably found the answer - but maybe this response will be useful to someone.
I've been battling a similar issue -> locally all was working fine (in GUI and non-GUI mode), but as soon as I tried to run the jmx on the server I could see it would start threads, all logs seemed normal (standard info logs within jmeter.log at start) but still no requests were actually made (confirmed by observing logs from the target server). I tried running trace logs but still nothing out of the ordinary - I could see proper HTTP config, threads were as if normal... But the generated jtl file only contained a header and no requests actually were made.
After some hair pulling I finally found my issue - I'm using variables for threads, rampup and loop which I invoke using ${__P(threads,)} syntax and when running the non-GUI load test I pass those with -J to the command line (f.ex. jmeter -Jthreads=50 ...)
I didn't pass the loop parameter since I figured it would just default to 1 (and that is also the impression I get when looking at the logs where I see all thread started ... entries) - turns out for some reason it will log, but won't execute anything actually till I pass a value for that loop.
So if you run a test plan and notice it only simulates doing something but you get no results in the target log file -> confirm you're setting ALL variables used for thread groups including those you suspect to default

Jmeter Cross-Platform Path config issue

I am working on master-slave Jmeter configuration, my data set exist on each machine on a different path for (macOS, Windows).
I use a global data set to fetch data for multiple thread groups.
However, the variable/property can be different across platforms.
I also tried the JSR223 to check the, but still no luck. check out the below snapshot.
I am trying to make sure that once I ran my test from Master (Mac), it also run on Windows.
Any thoughts how to do that on multiple platform setup.
The best solution is placing your test data under the same path which will be relative to JMeter working directory, this way you will not have to change anything in your script.
If for some reason you cannot afford this you can add a JSR223 Sampler to your Test Plan and use the code like:
if (org.apache.commons.lang3.StringUtils.containsIgnoreCase(System.getProperty('os.name'), 'Windows')) {
vars.put('data-path', 'c:/windows/specific/path')
} else {
vars.put('data-path', '/macos/specific/path')
}
It will detect the operating system name in the runtime and you will be able to define an OS-specific paths using the above approach.
vars is a shorthand for JMeterVariables class instance, the above code defines ${data-path} JMeter Variable which you can use later on for specifying data files locations. See Top 8 JMeter Java Classes You Should Be Using with Groovy to learn more about JMeter API shortcuts exposed to JSR223 Test Elements

Performance Testing of OBIEE application?

Following parameters should be set for OBIEE Presentation Server only during load testing.
OBIPS\instanceconfig.xml
save and exit file Restart OBIEE processes using OBIEE EM console.
<ServerInstance>
[...]
<Cursors>
<NewCursorWaitSeconds>36000</NewCursorWaitSeconds>
<OldCursorWaitSeconds>36000</OldCursorWaitSeconds>
</Cursors>
[...]
</ServerInstance>
You do know that this represents a value of 10 hours, correct? You are willing to lock resources for that length of time? This is counterintuitive for optimal application performance as you would seek to recover resources as fast as possible to support more sessions versus locking a resource for an extended period of time.
I refer to the following performance "compass rose" as a guiding item (independent of tool)
If you need to amend the file on a remote server you can do this either via OS Process Sampler or via SSH Command Sampler. The first one is a part of JMeter installation, the second one you can install using JMeter Plugins Manager
See How to Run External Commands and Programs Locally and Remotely from JMeter for more information, example configuration and sample commands.

Jmeter on Windows 10(Master) is not receiving test results from Slave

I am performing remote distributed testing through JMeter on my windows machine as master (Windows 10) and amazon Linux as the slave. I have configured jmeter.properties with client.rmi.localport and server.rmi.localport on both.
All configurations are fine as I can connect and remote start my JMeter server.
But I am not able to see the test results on my master machine.
I could see the results on Windows 7 with same configurations in jmeter.properties.
Also, I saw one more process JMeterMenuBar: setRunning(true,127.0.0.1:****) & JMeterMenuBar: setRunning(false,127.0.0.1:****) on Windows 7 but can't see these on Windows 10.
Please resolve for this.
Being not enough telepathic unfortunately I cannot identify and fix your issue remotely. However here are few possible workarounds:
Copy JMeter and Java folders from Windows 7 to Windows 10 machine.
Enable extra debug logging on Windows 7, Windows 10 and remote JMeter engines by adding the next line to user.properties file:
log_level.jmeter=DEBUG
and compare the output in both cases
You can also try adding the next line to system.properties file
java.net.preferIPv4Stack=true
as Windows 10 might be using IPv6 addresses by default or it may be something due to dual stack clash
And finally, JMeter automatically removes response data from successful samplers, it means you won't be able to see anything apart pass/fail flag and some timings. If you need to see the response data as well - add the next line to user.properties file on remote engines:
mode=Standard
JMeter restart is required to pick any property change up
See Apache JMeter Properties Customization Guide for more information on JMeter properties and ways of working with them
Thanks for your help.
I had the logs enabled and after posting the question I found one of the java class which JMeter is invoking is corrupted and hence I am unable to see the response on Master.
I re-installed JAVA JDK and it worked fine.

Resources