Mapping Test Types to JMeter
Every test type in Performance Testing Fundamentals uses the same script with a different load shape. In JMeter, that means one test plan whose Thread Group reads its settings from properties, so the command line picks the shape.
Set up the Thread Group once
Put a property function in each Thread Group field instead of a fixed number. The second argument is the default used when no -J value is passed:
| Thread Group field | Value |
|---|---|
| Number of Threads (users) | ${__P(users,1)} |
| Ramp-up period (seconds) | ${__P(rampup,1)} |
| Loop Count | ${__P(loops,1)} |
| Duration (seconds), with Specify Thread lifetime ticked | ${__P(duration,60)} |
Then run it in non-GUI mode and pass the values:
jmeter -n -t test_plan.jmx -l results.jtl -Jusers=1000 -Jrampup=30 -Jloops=-1 -Jduration=1800
Properties per test type
| Type | Example properties |
|---|---|
| Smoke | -Jusers=5 -Jloops=1 |
| Load | -Jusers=1000 -Jrampup=30 -Jloops=-1 -Jduration=1800 |
| Stress | Separate runs at increasing levels (e.g. 1,200, then 1,500, then 2,000), or a Concurrency Thread Group plugin to step up within one run |
| Endurance | -Jusers=1000 -Jrampup=600 -Jloops=-1 -Jduration=14400 (4 hours) |
| Spike | -Jusers=2000 -Jrampup=5 -Jloops=-1 -Jduration=300 |
| Scalability | The stress runs again after each infrastructure change (e.g. 2 app servers, then 4), comparing the capacity at each size |
note
A standard Thread Group cannot step load up within a single run. For stress or scalability tests in one run, use the Concurrency Thread Group or Ultimate Thread Group from JMeter Plugins.