JMeter to ignore warmup period

482 Views Asked by At

Contrary to How to exclude warmup time from JMeter summary?, as I don't want to spin up 20 threads all at once. Instead,

I want to ignore a certain warmup period (or a certain iterations), to exclude the initial visit outliers, illustrated clearly in the following chart:

enter image description here

Very close to JMeter structure warmup, however, not specifically to "a child of the request you want to ignore". I.e., I want to apply to all samplers/requests for all threads.

So instead of "Add JSR223 PostProcessor as a child of the request you want to ignore", I need to add a generic JSR223 PostProcessor at thread group level to control all samplers/requests. Is that possile? If so, how should I do? I remember that the JSR223 code should mention parent() or something like that.

2

There are 2 best solutions below

6
Ori Marko On BEST ANSWER

After you get results you can exe ute Filter Results Tool to remove warm up using start-offset parameter with seconds

If you want to remove the ramp-up phase, you could use offset filters.

FilterResults.sh --output-file filteredout.xml --input-file inputfile.csv --start-offset 2

4
Dmitri T On

You can add a JSR223 PostProcessor to your test plan and use the following code to discard sample results which are within the ramp-up phase:

if (System.currentTimeMillis() - (vars.get('TESTSTART.MS') as long) <= ctx.getThreadGroup().getPropertyAsLong('ThreadGroup.ramp_time') * 1000) {
    prev.setIgnore()
}

where:

More information: Top 8 JMeter Java Classes You Should Be Using with Groovy