Skip to content

Instantly share code, notes, and snippets.

@2013techsmarts
Created January 29, 2017 08:21
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/3feb12662e3a15db4133c5c0d047beed to your computer and use it in GitHub Desktop.
Save 2013techsmarts/3feb12662e3a15db4133c5c0d047beed to your computer and use it in GitHub Desktop.
package org.smarttechie
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
import com.typesafe.config._
class SampleFeederRESTEndPointPrefSimulation extends Simulation {
val conf = ConfigFactory.load()
val postsFeed = csv("posts.csv").circular //CSV Feeder
val baseUrl = conf.getString("baseUrl")
val httpProtocol = http.baseURL(baseUrl) //sample comment
val restEndPoint = "/posts/${post_id}" // The value of the post_id filed from the feed will go here.
val restEndpointScenario = scenario("Posts_Pref_Feed_Simulation")
.feed(postsFeed) //pass the feed for scenario
.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