'ThreadGroup execution on Dedicated VM using JMeter
I am using below test plan for testing. MyTestThreadGroup (Concurrent users:5) IfController(${__groovy( "${__machineIP()}"!="10.0.0.4")} Request1 This threadgroup will spin 5 concurrentuser for given duration of test. If IP matches it will execute Request1. If IP does not match it wont execute request1, but does it spin 5 concurrent users even if condition/IP does not match?
Solution 1:[1]
Yes it does.
If you don't want to kick off 5 users if the IP address is not the one you're looking for you can use __groovy() function in the Thread Group
${__groovy(if (org.apache.jmeter.util.JMeterUtils.getLocalHostIP()=='10.0.0.4') return '0' else return '5',)}
Also don't inline JMeter Functions or Variables into Groovy scripts, go for code-based equivalents instead, i.e. instead of ${__machineIP()} use JMeterUtils.getLocalHostIP() function
More information: Apache Groovy - Why and How You Should Use It
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dmitri T |

