Is there a way to set jmeter properties when using ruby-jmeter
We are building a performace testplan using ruby-jmeter. Our graphs show granularity as 1 min.
We want to reduce the granularity to 1000ms.
Is there a way to set this up in ruby-jmeter?
When you're running your test plan locally you can specify JMeter installation location via path attribute. All properties customizations (i.e. from user.properties file) will be picked up.
It's also possible to specify the custom location of the jmeter properties file via properties attribute.
test do
threads count: 1 do
visit name: 'Example domain', url: 'http://example.com'
end
end.run(
path: '/path/to/your/jmeter/bin',
file: 'test.jmx',
log: 'jmeter.log',
jtl: 'result.jtl',
properties: 'jmeter.properties')
^^^^^^^^^^
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide
Related
I am trying to pass the loopCount and threadCount values from the jmeter user.properties
file in azure pipeline in the Azure load test.
It is still taking the default value of 1 and just running 1 thread and 1 loop. I have been following the link
"https://learn.microsoft.com/en-us/azure/load-testing/how-to-configure-user-properties?pivots=experience-azp"
Jmeter View for Thread Porperties:
And i have added these lines in user.property file:
Have also added this in my YAMl file :
properties:
userPropertyFile: 'user.properties'
Not sure where it is going wrong..Any help would be appreciated
Not initialized properties have default value of 1 to it means that JMeter doesn't pick up your .properties file at all.
If your file is called user.property the correct YAML syntax would be:
properties:
userPropertyFile: user.property
More information:
Use JMeter user properties with Azure Load Testing Preview
Apache JMeter Properties Customization Guide
I am outputting results from 30 tests to a single xml file.
Currently the file includes latency, connection time, and whether it returned OK. I want the endpoint I am hitting to also be shown. My tests run in sequence and output to a single file.
It's Save URL checkbox:
You can also achieve the same by amending JMeter Results File Configuration like:
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.time=true
jmeter.save.saveservice.filename=true
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.url=true
and others set to false
Put your changes to user.properties file, JMeter restart will be required to activate the changes.
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide
I have the following params setup on jmeter, I am running my script in a loop which is creating huge logs(jtl file), Can I log only error responses ?
You can configure JMeter to save response data only for failed samplers by adding the next lines to user.properties file:
jmeter.save.saveservice.response_data=false
jmeter.save.saveservice.response_data.on_error=true
If you want to completely disable saving any metrics for successful samplers add the next line to the same file (however you won't be able to get reliable metrics this way):
jmeter.save.saveservice.successful=false
References:
Configuring JMeter
Apache JMeter Properties Customization Guide
My test plan use a parameter as startIndex.
In local case:
"thread pool 1" -> "Java Request" -> "Send Parameters With the Request" -> Add a parameter named startIndex,
and Create a config element - "User Defined variables", and give a parameter startIndex.
But how to give different startIndex parameters to each server,
for example:
serverA:"startIndex"=100, serverB:"startIndex"=200.
On each JMeter slave machine locate user.properties file under /bin folder of your JMeter installation
Add the following lines to this file:
on server 1: startIndex=100
on server 2: startIndex=200
Refer startIndex property value via __P() function as ${__P(startIndex,)} where required
Make sure you restart JMeter after user.properties file modification.
See Apache JMeter Properties Customization Guide for extended information on JMeter properties and ways of working with them
It is not a best practice to have create two variables having same names. If this situation is unavoidable then do not use 'user defined variables. Instead you can create the second variable under specific sampler, by using beanshell (vars.put) to create second variable. Not a tested technique but you can try.
Is it possible to re-read jmeter.properties without closing and restarting JMeter?
Maybe any additional class that will trigger this process?
Sometimes I need to play with a property's values, and it is not convenient to restart JMeter every time, so I'd like to automate this process.
There is no need to re-read jmeter properties from file - jmeter has enough built-in functionality to read/set values of properties.
At least the following below:
jmeter functions:
_setProperty(),
_property(),
__P;
props - JMeterProperties (class java.util.Properties) - to access from beanshell code;
Property Display.
Look also into the following for more info and examples:
Using JMeter properties
How to set a javascript value as a JMeter property
Jmeter Wiki