Gatling for Batch process trigger/execution

565 views
Skip to first unread message

Jebuselwyn Martin

unread,
Jan 13, 2016, 9:49:07 AM1/13/16
to Gatling User Group
Hi,
We've recently started gatling for our perf-test execution as an alternative to LoadRunner based tests. So far the experience is pretty good. Thanks for this great tool.

Is there any option to enable or trigger a batch process from within a simulation?

Usecase:

We have UI or REST service tests which run and in between we want to load or run our scheduled jobs at regular intervals. In LoadRunner world, this is not possible, so we do this manually when the LoadRunner execution happens. Was wondering if some option is available to just allocate a vUser at some time to make a 'java' method call and wait on it until it completes. I'm aware that gatling will not be able to trap the request/response timing etc for such scenarios, but detailed level of analysis is gathered via our perf-logs.

Thanks,
Jebu.

Stéphane LANDELLE

unread,
Jan 17, 2016, 4:20:13 PM1/17/16
to gat...@googlegroups.com
Hi,

What are you trying to achieve exactly? Init some data prior to running the actual test?
Gatling simulations are Scala code, so you can plug there whatever you want.

Stéphane Landelle
GatlingCorp CEO


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jebuselwyn Martin

unread,
Apr 22, 2016, 2:39:03 AM4/22/16
to Gatling User Group
Sorry for the delayed response. 

No. Not loading pre-requisite data, but simulating a production usecase where batch-processes could be running in parallel to UI/API transactions. The batch-processes are normally triggered via a Java command-line. So wondering if there is an simple exec() example which invokes a Java method instead of bundling it into a http request call.

i.e few users will be just assigned to call the java-method which does batch-processing.

scenario("batch-trigger")
 .during(10 minutes)(
   exec(?? -- how to call the java-method here)
).inject(rampUsers (1) over (10 minutes))


Thanks,
Jebu.

John Arrowwood

unread,
Apr 22, 2016, 1:00:15 PM4/22/16
to Gatling User Group
This should do it:

.exec( { session => /* call the java function */ } )

Stéphane LANDELLE

unread,
Apr 29, 2016, 3:34:27 AM4/29/16
to gat...@googlegroups.com
Just beware that your trigger is non blocking. If it's not, wrap it and execute it in its own thread pool.

Stéphane Landelle
GatlingCorp CEO


Reply all
Reply to author
Forward
0 new messages