Triggering of a specific thread group within a JMX from Taurus

818 views
Skip to first unread message

dipanja...@gmail.com

unread,
Sep 30, 2015, 2:47:14 AM9/30/15
to codename-taurus


If I have multiple thread group inside a single JMX file, is it possible to trigger any specific thread group of that JMX from the yml. If so, could you please provide a sample yml

Regards
Dipanjan

Andrey Pokhilko

unread,
Sep 30, 2015, 3:51:37 AM9/30/15
to codenam...@googlegroups.com
Hi,

Yes, it is achievable. To use it, you should rely on thread group naming in JMX + modification feature in Taurus.

Let's assume you have 3 thread groups inside your existing.jmx file, named "Thread Group 1", "Thread Group 2", "Thread Group 3". If you want to have only Thread Group 2 running, your config would be:

---                                                                                                                                                                                                                                          
scenarios:                                                                                                                                                                                                                                   
  my-jmx:                                                                                                                                                                                                                                    
    script: existing.jmx                                                                                                                                                                                                                     
    modifications:                                                                                                                                                                                                                           
      disable:                                                                                                                                                                                                                               
         - "Thread Group *"                                                                                                                                                                                                                  
      enable:
         - "Thread Group 2"

execution:
  - scenario: my-jmx
    concurrency: 10
    hold-for: 5

To make sure you have it working properly, try running it with "bzt modif.yml -gui", it will open JMeter GUI to see resulting test plan.

By using "modifications" feature you first say to disable all components which start with "Thread Group ", then enable thread group named "Thread Group 2". These modifications apply to all elements of JMX, you can disable samplers, controllers, configs, anything.


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter
--
You received this message because you are subscribed to the Google Groups "codename-taurus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/97556277-6af5-49f0-9895-1ea2fee66729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dipanja...@gmail.com

unread,
Sep 30, 2015, 4:45:12 AM9/30/15
to codename-taurus
Hi Andrey,

Thanks for the solution. But when I upgraded my Yaml file to include the suggested changes, the tests is not getting executed. I am attaching both the yaml files for your reference.

Before updating:
---   
execution:
  concurrency: 10
  ramp-up: 1m
  steps: 5
  hold-for: 2m30s
  scenario:
    script: test.jmx
    variables:
       smphost: xxxxxxxxxx
       smpport: 8080


After Updating:

---                                                                                                                                                                                                                                          
scenarios:                                                                                                                                                                                                                                   
  my-jmx:                                                                                                                                                                                                                                    
    script: test.jmx                                                                                                                                                                                                                     
    modifications:                                                                                                                                                                                                                           
      disable:                                                                                                                                                                                                                               
         - "Test*"                                                                                                                                                                                                                  
      enable:
         - "Test2"

execution:
  - scenario: my-jmx
    concurrency: 10
    ramp-up: 1m
    hold-for: 5
    variables:
       smphost: xxxxx
       smpport: 8080


While I am running i am getting the below error:

14:08:51 INFO: Starting...
14:08:52 INFO: Waiting for finish...
14:08:52 INFO: Test is running...
14:08:53 INFO: Shutting down...
14:08:53 ERROR: Error while shutting down: Traceback (most recent call last):
  File "C:\Dipanjan\bzt\lib\site-packages\bzt\engine.py", line 150, in _shutdow

    self.provisioning.shutdown()
  File "C:\Dipanjan\bzt\lib\site-packages\bzt\modules\provisioning.py", line 58
 in shutdown
    executor.shutdown()
  File "C:\Dipanjan\bzt\lib\site-packages\bzt\modules\jmeter.py", line 193, in
hutdown
    raise RuntimeWarning(msg % self.kpi_jtl)
RuntimeWarning: Empty results JTL, most likely JMeter failed: c:\Automation\Tau
us\2015-09-30_14-08-51.8hzl_y\kpi.jtl

14:08:53 ERROR: Exception: Empty results JTL, most likely JMeter failed: c:\Aut
mation\Taurus\2015-09-30_14-08-51.8hzl_y\kpi.jtl
14:08:53 WARNING: Please wait for graceful shutdown...
14:08:53 INFO: Post-processing...
14:08:53 INFO: Test duration: 0:00:02
14:08:53 INFO: Artifacts dir: c:\Automation\Taurus\2015-09-30_14-08-51.8hzl_y
14:08:53 INFO: Done performing with code: 1
14:08:53 ERROR: Exception: [Error 32] The process cannot access the file becaus
 it is being used by another process: 'bzt.log'


Regards
Dipanjan

Andrey Pokhilko

unread,
Sep 30, 2015, 6:23:41 AM9/30/15
to codenam...@googlegroups.com
Can you run it with -gui option to see what components do you have disabled/enabled and make sure it matches your expectation?



Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter

dipanja...@gmail.com

unread,
Sep 30, 2015, 6:26:04 AM9/30/15
to codename-taurus
Hi Andrey,

I tried that and it correctly disables the threadgroup which i have specified in the yml. It encounters the error once i start executing the test.

Regards
Dipanjan

Andrey Pokhilko

unread,
Sep 30, 2015, 6:27:52 AM9/30/15
to codenam...@googlegroups.com
Do you have any errors in your jmeter.log file?


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter
Message has been deleted

Andrey Pokhilko

unread,
Sep 30, 2015, 6:53:35 AM9/30/15
to codenam...@googlegroups.com
Can't it be that you have disabled all the items?

I guess you don't notice that your whole Test Plan is called starting with "Test" and was also disabled. Try renaming it. Or change naming for thread groups.


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter
On 09/30/2015 01:31 PM, dipanja...@gmail.com wrote:
Hi Andrey,

This the error i get in the jmeter log:

015/09/30 14:38:51 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: Copyright (c) 1998-2015 The Apache Software Foundation 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: Version 2.13 r1665067 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: java.version=1.8.0_51 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) Client VM 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: os.name=Windows 7 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: os.arch=x86 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: os.version=6.1 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: file.encoding=Cp1252 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: Default Locale=English (United States) 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: JMeter  Locale=English (United States) 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: JMeterHome=C:\Users\I312408\.bzt\jmeter-taurus 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: user.dir  =c:\Automation\Taurus\2015-09-30_14-38-50.ieu0gp 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: PWD       =C:\Automation\Taurus\2015-09-30_14-38-50.ieu0gp 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: IP: 10.53.208.225 Name: INLN50877632A FullName: INLN50877632A.apj.global.corp.sap 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: user.classpath=c:/Automation/Taurus/2015-09-30_14-38-50.ieu0gp 
2015/09/30 14:38:51 INFO  - jmeter.JMeter: Adding to classpath and loader: c:/Automation/Taurus/2015-09-30_14-38-50.ieu0gp 
2015/09/30 14:38:52 INFO  - jmeter.services.FileServer: Default base='c:\Automation\Taurus\2015-09-30_14-38-50.ieu0gp' 
2015/09/30 14:38:52 INFO  - jmeter.services.FileServer: Set new base='c:\Automation\Taurus\2015-09-30_14-38-50.ieu0gp' 
2015/09/30 14:38:52 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 
2015/09/30 14:38:52 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8 
2015/09/30 14:38:52 INFO  - jmeter.save.SaveService: Using SaveService properties file version 1656252 
2015/09/30 14:38:52 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.8 
2015/09/30 14:38:52 INFO  - jmeter.save.SaveService: All converter versions present and correct 
2015/09/30 14:38:52 INFO  - jmeter.save.SaveService: Loading file: c:\Automation\Taurus\2015-09-30_14-38-50.ieu0gp\modified_test.jmx.jmx 
2015/09/30 14:38:52 INFO  - jmeter.protocol.http.control.CookieManager: Settings: Delete null: true Check: true Allow variable: true Save: false Prefix: COOKIE_ 
2015/09/30 14:38:52 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: No response parsers defined: text/html only will be scanned for embedded resources 
2015/09/30 14:38:52 ERROR - jmeter.JMeter: Error in NonGUIDriver java.lang.ArrayIndexOutOfBoundsException: 0
at org.apache.jmeter.JMeter.runNonGui(JMeter.java:792)
at org.apache.jmeter.JMeter.startNonGui(JMeter.java:737)
at org.apache.jmeter.JMeter.start(JMeter.java:395)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.jmeter.NewDriver.main(NewDriver.java:264)


Regards
Dipanjan

dipanja...@gmail.com

unread,
Sep 30, 2015, 6:54:25 AM9/30/15
to codename-taurus
Hi Andrey,

I get some errors in the Jmeter. But this error comes only if i run the yml with the modification option enabled. If i run the yml without the modifications it runs absolutely fine.

015/09/30 16:02:25 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: Copyright (c) 1998-2015 The Apache Software Foundation 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: Version 2.13 r1665067 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: java.version=1.8.0_51 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) Client VM 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: os.name=Windows 7 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: os.arch=x86 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: os.version=6.1 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: file.encoding=Cp1252 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: Default Locale=English (United States) 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: JMeter  Locale=English (United States) 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: JMeterHome=C:\Users\I312408\.bzt\jmeter-taurus 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: user.dir  =c:\Automation\Taurus\2015-09-30_16-02-23.ng01to 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: PWD       =C:\Automation\Taurus\2015-09-30_16-02-23.ng01to 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: user.classpath=c:/Automation/Taurus/2015-09-30_16-02-23.ng01to 
2015/09/30 16:02:25 INFO  - jmeter.JMeter: Adding to classpath and loader: c:/Automation/Taurus/2015-09-30_16-02-23.ng01to 
2015/09/30 16:02:25 INFO  - jmeter.services.FileServer: Default base='c:\Automation\Taurus\2015-09-30_16-02-23.ng01to' 
2015/09/30 16:02:25 INFO  - jmeter.services.FileServer: Set new base='c:\Automation\Taurus\2015-09-30_16-02-23.ng01to' 
2015/09/30 16:02:25 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 
2015/09/30 16:02:25 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8 
2015/09/30 16:02:25 INFO  - jmeter.save.SaveService: Using SaveService properties file version 1656252 
2015/09/30 16:02:25 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.8 
2015/09/30 16:02:25 INFO  - jmeter.save.SaveService: All converter versions present and correct 
2015/09/30 16:02:25 INFO  - jmeter.save.SaveService: Loading file: c:\Automation\Taurus\2015-09-30_16-02-23.ng01to\modified_test.jmx.jmx 
2015/09/30 16:02:25 INFO  - jmeter.protocol.http.control.CookieManager: Settings: Delete null: true Check: true Allow variable: true Save: false Prefix: COOKIE_ 
2015/09/30 16:02:25 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: No response parsers defined: text/html only will be scanned for embedded resources 
2015/09/30 16:02:25 ERROR - jmeter.JMeter: Error in NonGUIDriver java.lang.ArrayIndexOutOfBoundsException: 0
at org.apache.jmeter.JMeter.runNonGui(JMeter.java:792)
at org.apache.jmeter.JMeter.startNonGui(JMeter.java:737)
at org.apache.jmeter.JMeter.start(JMeter.java:395)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.jmeter.NewDriver.main(NewDriver.java:264)


dipanja...@gmail.com

unread,
Sep 30, 2015, 6:58:09 AM9/30/15
to codename-taurus, dipanja...@gmail.com
Thanks Andrey, i got it working now.

Regards
Dipanjan
Reply all
Reply to author
Forward
0 new messages