Created
September 17, 2019 16:08
-
-
Save joshuacronemeyer/a781c7013b0c9fa5071e2e8985af8ab5 to your computer and use it in GitHub Desktop.
Gatling test i'm having trouble running on Flood
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.gatling.core.Predef._ | |
import io.gatling.http.Predef._ | |
import scala.concurrent.duration._ | |
import java.util.Date._ | |
import java.text.SimpleDateFormat._ | |
// Mandatory, you must import Flood libraries | |
import flood._ | |
class TestPlan extends Simulation { | |
// Optional, Tricentis Flood will pass in threads, rampup and duration properties from UI | |
val threads = Integer.getInteger("threads", 100) | |
val rampup = java.lang.Long.getLong("rampup", 30L) | |
val duration = java.lang.Long.getLong("duration", 300L) | |
// Mandatory, you must use httpConfigFlood | |
val httpConf = httpConfigFlood.baseURL("https://core.staging.laneone.com/") | |
val myScenario = scenario("scenario") | |
.during(duration seconds) { | |
exec( | |
http("Reserve some tickets") | |
.post(_ => s"test_api/reserve_tickets") | |
.body(StringBody(session => s"""{ "event_id": "1148", "ticket_quantity": "2" }""")).asJSON | |
.basicAuth("****", "****") | |
.asJSON | |
.check(status.in(200, 201)) | |
) | |
} | |
setUp(myScenario.inject(rampUsers(threads) over (rampup seconds))).protocols(httpConf) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment