Skip to content

Instantly share code, notes, and snippets.

@ousado
Created April 10, 2018 18:07
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 ousado/44a77fcffb53f5a5963800e3cae0ed82 to your computer and use it in GitHub Desktop.
Save ousado/44a77fcffb53f5a5963800e3cae0ed82 to your computer and use it in GitHub Desktop.
simulation
package kp00
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class RecordedSimulation extends Simulation {
val httpProtocol = http
.baseURL("http://ocsp.digicert.com")
.inferHtmlResources()
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
.acceptEncodingHeader("gzip, deflate")
.acceptLanguageHeader("en-US,en;q=0.5")
.userAgentHeader("Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0")
val headers_0 = Map("Upgrade-Insecure-Requests" -> "1")
val headers_1 = Map("Content-Type" -> "application/ocsp-request")
val headers_7 = Map("Accept" -> "*/*")
val uri1 = "http://clients1.google.com/ocsp"
val uri2 = "http://ciscobinary.openh264.org/openh264-linux64-6c2e7008f8bbe2ff90100972f97071eb87ec37cb.zip"
val uri4 = "http://testing.kickprophet.com"
val scn = scenario("RecordedSimulation")
.exec(http("request_0")
.get(uri4 + "/")
.headers(headers_0))
.pause(1)
.exec(http("request_1")
.post(uri1 + "")
.headers(headers_1)
.body(RawFileBody("RecordedSimulation_0001_request.txt"))
.resources(http("request_2")
.post(uri1 + "")
.headers(headers_1)
.body(RawFileBody("RecordedSimulation_0002_request.txt")),
http("request_3")
.post("/")
.headers(headers_1)
.body(RawFileBody("RecordedSimulation_0003_request.txt"))))
.pause(425)
.exec(http("request_4")
.post("/")
.headers(headers_1)
.body(RawFileBody("RecordedSimulation_0004_request.txt"))
.resources(http("request_5")
.post("/")
.headers(headers_1)
.body(RawFileBody("RecordedSimulation_0005_request.txt")),
http("request_6")
.post("/")
.headers(headers_1)
.body(RawFileBody("RecordedSimulation_0006_request.txt")),
http("request_7")
.get(uri2 + "")
.headers(headers_7),
http("request_8")
.post("/")
.headers(headers_1)
.body(RawFileBody("RecordedSimulation_0008_request.txt"))))
setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment