Sunday, February 7, 2016

Gatling simple simulation example

This a simple Gatling simulation example. The POST request is already explained in my earlier blog Gatling post request with JSON body
The example will run the scenario using 5 users for 10 minutes duration with no pauses.
import net.liftweb.json.DefaultFormats
import net.liftweb.json.Serialization._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.core.scenario.Simulation

class MySimulation extends Simulation {
  case class Person(name: String)

  val createPerson = http("Create person")
    .body(StringBody(session => write(Person("Jack"))(DefaultFormats))).asJSON

  val httpProtocol = http

  val myScenario = scenario("My scenario").during(10) {


No comments:

Post a Comment