Using Gatling to drive Java code

2,221 views
Skip to first unread message

Emerson Farrugia

unread,
Feb 6, 2013, 6:43:37 AM2/6/13
to gat...@googlegroups.com
Hi,

I've read through the first steps and advanced guides, and poked around the wiki, but I still need a bit more direction. Apologies if this is a repetition or I've missed documentation on it. 

I'd like to load test a web application which sits behind a Flash Rich Internet Application. In short, the Flash client makes AMF calls to a BlazeDS Java endpoint. The load testing frameworks I've found so far that speak AMF are proprietary, expensive, and/or unproven. To keeps things simple and feasible, I want to cut out the Flash side and instead load test by making direct Java calls to the endpoint, and get statistics for those calls. From what I've read, Scala and Java are byte code compatible and straightforward to integrate, and Gatling can cope with the large number of actors I need. So I could theoretically achieve what I need if I can get Gatling scenarios to make the method calls.

Are there examples or references on writing scenarios that make Java calls in this way? 

Thanks,
Emerson



  

Stéphane Landelle

unread,
Feb 6, 2013, 7:33:27 AM2/6/13
to gat...@googlegroups.com
Hi,

Yes, using Java code from Scala is very straightforward (the other way is a bit more tricky). Actually, we use a lot of Java library in Gatling, like Netty and async-http-client.

We have yet to provide extension point over HTTP so one can plug in a serializer/deserializer. We intend to do that in Gatling 2. This feature would be useful for other serialization protocols such as GWT-RPC.

Which java AMF library do you have in mind. I guess it implies providing the Java DTO classes, right?

Cheers,

Stéphane


2013/2/6 Emerson Farrugia <emerson....@gmail.com>



  

--
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/groups/opt_out.
 
 

Emerson Farrugia

unread,
Feb 6, 2013, 8:14:21 AM2/6/13
to gat...@googlegroups.com
Hi,

Is there any example you can point me to of a Gatling scenario making a Java call? That would really help me piece this together.

re: for AMF, IIRC, either Adobe's BlazeDS or LiveCycle Data Services handle the serialisation to and from Java DTOs when using a Java backend (the Spring BlazeDS project delegates to the former)

Thanks,
Emerson

Stéphane Landelle

unread,
Feb 6, 2013, 11:37:12 AM2/6/13
to gat...@googlegroups.com
I thought you wanted to "just" serialize requests and deserialize responses into AMF, but let Gatling handle the HTTP transport.

Now I properly understand what you're up to. You have to write your own protocol support. You can find a WIP documentation here: https://github.com/excilys/gatling/wiki/Protocol-support

Cheers,

Stéphane 

Andrew Duffy

unread,
Feb 6, 2013, 11:43:54 AM2/6/13
to gat...@googlegroups.com
I'm planning on writing a simple protocol handler to run code and record the runtime on a flight this Friday; the DSL I have in mind is something like this:

exec(fn("my_call"){session => 
  <do whatever>
  session
}.check(timeInMillis.lessThan(1500)))

I'll post the results here.

Stéphane Landelle

unread,
Feb 6, 2013, 11:51:03 AM2/6/13
to gat...@googlegroups.com
Sounds like someone's going to Nescala :)

Looks nice.
What about success/failure? Failure = Exception?


2013/2/6 Andrew Duffy <adu...@gilt.com>

Andrew Duffy

unread,
Feb 6, 2013, 12:36:32 PM2/6/13
to gat...@googlegroups.com
Good point. That's the simplest way; I'll see if an obvious way to expose it comes to mind when I'm doing it.

No Nescala I'm afraid - redeye from JFK back home to DUB.

Stéphane Landelle

unread,
Feb 7, 2013, 4:51:59 AM2/7/13
to gat...@googlegroups.com
Good point. That's the simplest way; I'll see if an obvious way to expose it comes to mind when I'm doing it.
Cool, thanks! 

No Nescala I'm afraid - redeye from JFK back home to DUB.
Sorry for you... :) 

Jeff Sogolov

unread,
Feb 21, 2013, 8:11:13 PM2/21/13
to gat...@googlegroups.com
Is it possible to run jUnit tests as part of performance testing instead of creating an http url?

Stéphane Landelle

unread,
Feb 22, 2013, 1:04:06 AM2/22/13
to gat...@googlegroups.com
No.
If you're looking for a micro-benchmark solution on top of JUnit, I recommend JUnitBenchmarks: http://labs.carrotsearch.com/junit-benchmarks.html


2013/2/22 Jeff Sogolov <gso...@gmail.com>
Is it possible to run jUnit tests as part of performance testing instead of creating an http url?

--
Reply all
Reply to author
Forward
0 new messages