Ultimate Thread Group - Set parameter from command line

2,034 views
Skip to first unread message

Stefan H.

unread,
Apr 10, 2015, 5:25:37 AM4/10/15
to jmeter-...@googlegroups.com
Hi,

I would like to ask for a way to set parameters as properties when starting jmeter from the command line?
Right now I have several Testplans and I need to set my thread numbers and ramp-ups for each of these testplans. If there is a way to set properties using the command line would be a benefit.
The same behaviour is used by Throughput Shaping Timer Element using load_profile=const(10,10s). With this feature similar to the Throughput Shaping Timer I would be able to use variables in my Ultimate Thread Group. I would only need one testplan and I can control my settings by using the command line. Is there a way to use properties for Ultimate Thread Group or are there any chances to implement this in the future?

Thanks and best regards,
Stefan


gli...@gmail.com

unread,
Apr 11, 2015, 6:58:21 AM4/11/15
to jmeter-...@googlegroups.com
The approach is quite similar to the one, used in Throughput Shaping Timer, it is possible via __P() or __property() functions, for instance if you configure Ultimate Thread Group as follows:


And provide "duration" property value via user.properties file or -J command line argument, the script will run for the specified amount of time. 

./jmeter -Jduration=20 -n -t example.jmx -l example.jtl
Creating summariser <summary>
Created the tree successfully using example.jmx
Starting the test @ Sat Apr 11 13:50:12 MSK 2015 (1428749412405)
Waiting for possible shutdown message on port 4445
summary + 360838 in  16.4s = 22064.2/s Avg:     0 Min:     0 Max:    15 Err:     0 (0.00%) Active: 1 Started: 1 Finished: 0
summary + 119839 in     5s = 25866.4/s Avg:     0 Min:     0 Max:     5 Err:     0 (0.00%) Active: 0 Started: 1 Finished: 1
summary = 480677 in    21s = 22901.4/s Avg:     0 Min:     0 Max:    15 Err:     0 (0.00%)
Tidying up ...    @ Sat Apr 11 13:50:34 MSK 2015 (1428749434638)
... end of run

See Apache JMeter Properties Customization Guide for more information on various JMeter properties. 

Kerwin Pesirla

unread,
May 5, 2015, 12:30:43 AM5/5/15
to jmeter-...@googlegroups.com
I have had the similar issue with you and that I had to move files from here to there because I was creating the script from outside SaaS environment and the loadGenerator is inside SaaS. An easier approach I have done to this is assign the needed variables to a csv file. and you can retrieve these variables by using a "jp@gc - Variables From CSV File" in your jmeter.

That way, you can modify the csv if you need to change threads,duration,host,anything.. without modifying your jmeter ;)

Regards,
Kerwin

mole...@gmail.com

unread,
May 6, 2015, 4:58:53 AM5/6/15
to jmeter-...@googlegroups.com
Hi, 

As we also find the ability to configure ThroughputShapingTimer via "load_profile" property really useful to parametrize test scenarios, configuring the UltimateThreadGroup similarly would be of great value. 

I prepared enchancement to the UltimateThreadGroup, so that threads profile can be configured in the following way via property: 

ex: threads_profile=schedule(1,1s,1s,1s,1s) schedule(2,1s,3s,1s,2s)"

Documentation says, that configuring ThroughputShapingTimer via property is going to be abandoned in future, but still we see good value, that it brings. 

In light of this, let me know, if you would like to port our enhancement into the project - I'll provide the code. 

Andrey Pokhilko

unread,
May 6, 2015, 8:37:21 AM5/6/15
to jmeter-...@googlegroups.com, mole...@gmail.com
I think that example you gave above is not very obvious. Can you think of some better alternative to express the profile? Ideally with the same syntax that used for ThroughputShapingTimer.

--
Andrey

среда, 6 мая 2015 г., 11:58:53 UTC+3 пользователь mole...@gmail.com написал:

mole...@gmail.com

unread,
May 6, 2015, 11:27:56 AM5/6/15
to jmeter-...@googlegroups.com, mole...@gmail.com
My intention was to reflect the way UltimateThreadGroup is configured via GUI, as it's very flexible - for example desired number of threads can be added dynamically, without shutting down the ones already running. 

To better allign GUI naming convention, we can consider someting like: 

threads_schedule=spawn(1,1s,1s,1s,1s) spawn(2,1s,3s,1s,2s)
 
where sucessive spawn(..) parameters stand for: 

1st:  start thread count
2nd: initial delay
3rd : startup time
4th:  hold load for
5th:  shutdown time

I'm opened for any other proposal - naming convention can be easilly changed. 

Andrey Pokhilko

unread,
May 10, 2015, 3:24:14 PM5/10/15
to jmeter-...@googlegroups.com, mole...@gmail.com, mole...@gmail.com
I'm talking not about names (which are just string constants). But I got your point, I think it might worth implementing. 

You can create a pull request, and follow http://jmeter-plugins.org/wiki/DeveloperGuide/ to increase the chance of acceptance.

--
Andrey

среда, 6 мая 2015 г., 18:27:56 UTC+3 пользователь mole...@gmail.com написал:
Reply all
Reply to author
Forward
0 new messages