Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package computerdatabase
- import scala.concurrent.duration._
- import io.gatling.core.Predef._
- import io.gatling.http.Predef._
- class PTBI extends Simulation {
- // Optional, Flood IO will pass in threads, rampup and duration properties from UI
- val threads = Integer.getInteger("threads", 100)
- val rampup = Integer.getInteger("rampup", 540).toLong
- val duration = Integer.getInteger("duration", 1200).toLong
- val environment = "http://"+System.getProperty("environment")
- println(environment)
- val httpConf = http
- .baseURL(environment) // Here is the root for all relative URLs
- .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") // Here are the common headers
- .doNotTrackHeader("1")
- .acceptLanguageHeader("en-US,en;q=0.5")
- .acceptEncodingHeader("gzip, deflate")
- .userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0")
- // define the feeder
- val urlList = csv("ptbiurls.csv").random
- // define the scenario
- val scn = scenario("TEST")
- .exec(
- http("login")
- .get("/analytics/saw.dll?Logon&NQUser=weblogic&NQPassword=pt4wlsuat&Impersonate=nadavati")
- .check(status.is(200))
- ).pause(5)
- .repeat(100) {
- feed(urlList)
- .exec(
- http("${URL}")
- .get("${URL}")
- .check(status.is(200))
- ).pause(5)
- }
- setUp(scn.inject(rampUsers(threads) over (rampup seconds))).protocols(httpConf)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement