0

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.

xpt
  • 20,363
  • 37
  • 127
  • 216

2 Answers2

1

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

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks a lot Dmitri. That's the answer I've been waiting for! Please allow me to directly edit you reply so that the implication is clear, which is also the reason why I waited for your answer but finally chose @user7294900's answer as the answer. Thanks all the same. – xpt Jul 24 '22 at 17:27
  • Editing answers is for improving them, I fail to see how does your edit brings more value to it – Dmitri T Jul 24 '22 at 17:39
  • Well, making the implication clear will be helpful to the next person, IMHO, but I personally don't have any problem of your removing them, as I have spent time tried and have already known them myself. Removing them doesn't hurt me in any bit. – xpt Jul 24 '22 at 19:21
  • If you have a better answer then downvote mine and add yours – Dmitri T Jul 25 '22 at 07:20
0

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

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
  • Thanks for the reply, up-voting. However, my results is sending through backend listener live to Grafana, so I'd prefer ignoring them (not sending them at all instead) if possible. – xpt Jul 23 '22 at 20:40
  • @xpt can you move warm up phase to setup Thread group (which will be without listener)? – Ori Marko Jul 24 '22 at 04:46
  • hmm... so I tried to do warm up phase in setup Thread group, and hold all normal Thread groups after that. However, warm up actions done in the setup Thread group are still sending through the backend listener live to Grafana. So I guess there is no good way to prevent sending through the backend listener to Grafana so far. – xpt Jul 25 '22 at 15:22
  • hmm... so I tried to do warm up phase in setup Thread group, and hold all normal Thread groups after that. However, warm up actions done in the setup Thread group are still sending through the backend listener live to Grafana. So I guess there is no good way to prevent sending through the backend listener to Grafana so far. However, I can select period in Grafana to not including the warm up phase. So having a warm up phase in setup Thread group is a nice idea! – xpt Jul 25 '22 at 15:32
  • @xpt if listener is under regular thread group it should work – Ori Marko Jul 25 '22 at 16:23
  • Then maybe the influxdbMetricsSender, org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender is very special then. You can also tried it yourself. – xpt Jul 26 '22 at 00:27