anthonygauthier / jmeter-live-changes-config

JMeter Plugin exposing a REST API allowing users to manipulate thread values, variables, properties on-the-go.
MIT License
20 stars 8 forks source link

Plugin Won't Work in Jmeter Distributed Mode #36

Open georgejdli opened 2 years ago

georgejdli commented 2 years ago

I'd like to start by saying I appreciate the work going into this plugin and that this issue is for informational purposes for others looking to uses in a similar use case as mine.

Using the TestStateListener.startTest() method to start the plugin API server works find if you're running jmeter in single mode. If you try to run this in distributed mode however TestStateListeners are not registered for notifications on testStart/testEnd:

https://github.com/apache/jmeter/blob/157db3679a5ed14e97f4b7dd59f29b395217cd48/src/core/src/main/java/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java#L161 https://github.com/apache/jmeter/blob/de43727474fe9c345e7cd57d0d9b2e01adc05a4d/src/core/src/main/java/org/apache/jmeter/engine/StandardJMeterEngine.java#L178

When you run in distributed mode the RemoteJMeterEngineImpl the instantiates the test as a wrapper to the StandardJMeterEngine. But instead of calling StandardJMeterEngine.run() is calls StandardJMeterEngine.runTest() which does not register TestStateListeners for event! That means we are unable to start that API server for LiveChanges.

I don't think the LoopIterationListeners are registered either but I haven't been able to confirm this in the Jmeter code base. That means we don't have a way to change the thread count during test runtime.

anthonygauthier commented 2 years ago

Hi!

Thanks for documenting this, this feature is on the roadmap. However I haven't been able to work much on this plugin lately.

It is my objective to start back on it very soon though!

I'll definitely take a crack at it whenever I go back to working on this!

georgejdli commented 2 years ago

I'd be more than happy to contribute - problem is I don't know the Jmeter source code well enough to know where to start looking for ideas on how to make this work for Distributed Mode.

anthonygauthier commented 2 years ago

That'd make 2 of us then hahah! I've become accustomed with the way JMeter's source code works through writing this plugin and the elasticsearch backend listener... However, I'm by no means an expert. It'll take a lot of R&D to develop the feature

anthonygauthier commented 1 year ago

@georgejdli FYI, I will be coming back to this very soon as I've been getting the itch to start working on the plugin again.