Feeder API documentation

Hello,
I am looking for the Feeder API documentation page on the wiki. The link seem to redirect on the home page. Is there such a documentation? My problem is that I would like to use some random parameters in my tests without having to create CSV files. I wonder if it could be a solution to implement a feeder that would generate my parameters. If there is a better solution, do not hesitate, I am open to any advice.
Thanks a lot

Hi Joël,

Complete documentation for APIs will be made for next release (1.1.0)

In the mean time, you can check how built-in feeders were made (they use the Feeder API)

https://github.com/excilys/gatling/tree/1.0-maintenance/gatling-core/src/main/scala/com/excilys/ebi/gatling/core/feeder

The main idea is that you define a source and then a strategy to take elements from this source.

I suggest that you only create a RandomSource to create as many values as you need.

Then you can use the queue or random strategy to retrieve these values in the scenarios.

If you have any question, feel free to ask, it will help me write a comprehensive and understandable documentation fo the API :slight_smile:

Cheers,
BluePyth

Thank you very much for your rapid answer. I am having a look to the code, and I will try to implement a new FeederSource that fit my needs.

Ok !

You might have to add an import at the top of your scenarios to include your own feeder source :wink:

Here's how I create random emails for one of our tests:

import scala.util.Random
import com.excilys.ebi.gatling.core.feeder.Feeder

...
val random = new Random

...

val customFeeder = new Feeder() {
            def next = {
                val email = "%s%s%s" format("LOADTEST",
random.nextInt.toString, "@someDomain.com")
                Map("userEmail" -> email)
            }
        }

val scn = scenario("WebFlow4").feed(customFeeder)...

Then you can refer to that value in the chains with:

${userEmail}

Chris

This is the kind of stuff we’ll write down in a cookbook for 1.1.0.
Coming soon!

2012/3/2 Chris Carrier <ctcarrier@gmail.com>

Thank you for your help.
I implemented directly a new Feeder, because I had to generate an unknown number of request, and each request contains a timestand parameter, so I cannot use neither CircularFeeder nor RandomFeeder. I could use the QueueFeeder but I should generate the IndexedSeq first and it would consume unnecessary memory (or I missed something).

Hi Joël,

That’s the right approach: the source based feeder is meant for pulling from a finite pool of data.
I’m going to rename FeederBuilder into SourceBasedFeederBuilder to make it less confusing.

Cheers,

Steph

2012/3/5 Joël Vimenet <joel.vimenet@gmail.com>