user2173353
user2173353

Reputation: 4640

JMeter handle "test-completed" event

I calculate some statistics (e.g. average request duration) while my tests are running using code similar to this:

https://stackoverflow.com/a/27446405/2173353

However, I want to know when the test is done running (all the samplers have executed), so that I act upon the statistics then, and not before that. Essentially, I want to assert on the average duration of the requests when all requests are done.

Is there a way to execute code when the test is about to finish?

Upvotes: 0

Views: 260

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

You must probably be looking for the tearDown Thread Group. It is some form of "special" thread group, the difference from "normal" Thread Groups is that the tearDown Thread Group is being executed after all other Thread Groups therefore you will be able to perform your "near the end" actions there.

More information: How to Use the SetUp Thread Group in JMeter When Preparing a Load Test

Upvotes: 1

Related Questions