Skip to content

Instantly share code, notes, and snippets.

@2013techsmarts
Last active January 27, 2017 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2013techsmarts/871a5f1ec4f10de9c266c7518ec3b9e9 to your computer and use it in GitHub Desktop.
Save 2013techsmarts/871a5f1ec4f10de9c266c7518ec3b9e9 to your computer and use it in GitHub Desktop.
Sample Gatling simulation
package org.smarttechie
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class SampleRESTEndPointPrefSimulation extends Simulation {
val httpProtocol = http
.baseURL("<base url of your end point>") //the base url of your end point
val restEndPoint = "/posts" //provide the URI of your end point
val restEndpointScenario = scenario("Posts_Pref_Simulation")
.exec(http("request_1")
.get(restEndPoint))
setUp(restEndpointScenario.inject(rampUsers(1000) over (10 seconds))).protocols(httpProtocol)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment