Am 20.11.21 um 12:46 schrieb Vladimir Sitnikov: >> Do you have a rough idea, what the dsl would look like, or how the >> elements get mapped/detected to be a part of the dsl? > Commonly used elements have to be mapped manually for consistency reasons. > There might be a generic (string-like) approach to allow fine-tuning.
I wondered, whether we could add annotations and a annotations processor to generate code/classes, that could be used to setup dsl components. The annotations could be used for scanning for TestPlan elements on startup, too. > >> Could you elaborate a bit more on your plan, or would the extra module >> be really an add-on? > I am not sure yet. > It might be that it would be good enough to keep the dsl classes side by > side with the corresponding elements. > In other words, creating a module for a couple of classes might not be that > justified. When we try to get our code into modules, it might be a good idea to have this sorted out, before (but that should not let us keep from experimenting). Maybe start with a global org.apache.jmeter.experimental.dsl package/module name, and mash everything in there for a start? > >> Do you have a rough idea, what the dsl would look like > Something behind the lines of > > val plan = testPlan { > aggregateReport { > outputFile = File("...") > } > openModelThreadGroup { > schedule { > rate(50.0 / second) > random_arrivals(10.minutes) > } > transaction("hello") { > http("http://hello.example") > http("http://world.example") > } > } > } > > println(plan.toJxm()) > plan.execute() Kotlin has a very similar string template format to JMeter, is there a good way to distinguish those, or guard the JMeter ones? It seems, that `aggregateReport` has its parameters given by a closure (is that the right name?) , while `http` per positional parameter. Is this a Kotlin feature, that we can mix those, or is it only a first example and showing different ways of settings parameters on the elements? And a completely other construction site: Currently JMeter uses a global context, which could trip off users of the dsl, when they want to execute plans in parallel. Would this be worse, than now? Felix > > Vladimir >
OpenPGP_signature
Description: OpenPGP digital signature