Hi Peoples,
This is an announcement and a question rolled in one.
I have (a while back) created a Random Data Generator that is very helpful for test scenarios.
It is written in Scala, and I realised the other evening that Gatling will be easy to support.
I have created a Feeder for Gatling that exposes a super super flexible way to provided data (mock) into your tests.
import org.inosion.dadagen.api.scaladsl._
val feeder = dadagen asMaps {
field { "id".rownumber }.
field { "gender".gender }.
field { "firstname".name firstname }.
field { "surname".name surname }.
// Combine all the values together .. order (what it depends on) does not matter
field { "message".template("${id} - ${firstname} ${surname} (${gender}) i:${int} ${ref}")}.
field { "int".number between 10 and 99876 }.
field { "ref".regexgen("[a-f]{6}-[0-9a-f]{8}") }
} generate() // call generate to make the Iterator
val scn = scenario("scenario").feed(feeder).exec(http(....))
So my question, I added a quick test to show the feeder in use, but have a problem with the Action. Gatling seems to be waiting for my code to say it is “complete” for each user.
What do I need to do to “close” the Action // move the messages to Done.
(it will just help with the test - the feeder works
class DoNothingAction(val next: ActorRef) extends Chainable with Failable with DataWriterClient{
override def executeOrFail(session: Session): Validation[_] = {
val now = new Date().getTime
session.attributes.get("message") match {
case None => Failure("missing the message from the dadagen")
case Some(msg:String) => {
writeRequestData(session, session.scenarioName, now, now + 1, now + 3, now + 4, Status("OK"), Some(msg))
Success(msg)
}
}
}
}
regards
Ramon