Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b97fa6e34 |
+2
-4
@@ -23,10 +23,8 @@ tasks.withType(io.gatling.gradle.GatlingRunTask) {
|
||||
"-Dhealthz.path=${findProperty('healthzPath') ?: '/health'}",
|
||||
"-DmaxUsers=${findProperty('maxUsers') ?: '10'}",
|
||||
"-DrampDuration=${findProperty('rampDuration') ?: '60'}",
|
||||
"-DstartUsers=${findProperty('startUsers') ?: '2'}",
|
||||
"-DusersIncrement=${findProperty('usersIncrement') ?: '2'}",
|
||||
"-Dsteps=${findProperty('steps') ?: '2'}",
|
||||
"-DstepDuration=${findProperty('stepDuration') ?: '30'}"
|
||||
"-DconcurrentUsers=${findProperty('concurrentUsers') ?: '3'}",
|
||||
"-Dduration=${findProperty('duration') ?: '300'}"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ object BoardEndpoints {
|
||||
|
||||
val createGame: Endpoint = Endpoint(
|
||||
name = "Create Game",
|
||||
method = "POST",
|
||||
path = "/api/board/game/",
|
||||
expectedStatus = 201
|
||||
method = "GET",
|
||||
path = "/api/account/official-bots/",
|
||||
// expectedStatus = 200
|
||||
)
|
||||
|
||||
val all: List[Endpoint] = List(createGame)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package simulations
|
||||
|
||||
import base.BaseSimulation
|
||||
import endpoints.BoardEndpoints
|
||||
import io.gatling.core.Predef._
|
||||
|
||||
import scala.concurrent.duration._
|
||||
|
||||
class EnduranceTestSimulation extends BaseSimulation {
|
||||
|
||||
private val concurrentUsers = sys.props.getOrElse("concurrentUsers", "3").toInt
|
||||
private val duration = sys.props.getOrElse("duration", "300").toInt
|
||||
|
||||
setUp(
|
||||
BoardEndpoints.all.map { endpoint =>
|
||||
scenarioFromEndpoint(endpoint)
|
||||
.inject(
|
||||
constantConcurrentUsers(concurrentUsers).during(duration.seconds)
|
||||
)
|
||||
}: _*
|
||||
).protocols(httpProtocol)
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import scala.concurrent.duration._
|
||||
|
||||
class LoadTestSimulation extends BaseSimulation {
|
||||
|
||||
private val maxUsers = sys.props.getOrElse("maxUsers", "5").toInt
|
||||
private val maxUsers = sys.props.getOrElse("maxUsers", "10").toInt
|
||||
private val rampDuration = sys.props.getOrElse("rampDuration", "60").toInt
|
||||
|
||||
setUp(
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package simulations
|
||||
|
||||
import base.BaseSimulation
|
||||
import endpoints.BoardEndpoints
|
||||
import io.gatling.core.Predef._
|
||||
|
||||
import scala.concurrent.duration._
|
||||
|
||||
class StressTestSimulation extends BaseSimulation {
|
||||
|
||||
private val startUsers = sys.props.getOrElse("startUsers", "2").toInt
|
||||
private val usersIncrement = sys.props.getOrElse("usersIncrement", "2").toInt
|
||||
private val steps = sys.props.getOrElse("steps", "2").toInt
|
||||
private val stepDuration = sys.props.getOrElse("stepDuration", "30").toInt
|
||||
private val rampDuration = sys.props.getOrElse("rampDuration", "10").toInt
|
||||
|
||||
setUp(
|
||||
BoardEndpoints.all.map { endpoint =>
|
||||
scenarioFromEndpoint(endpoint)
|
||||
.inject(
|
||||
incrementConcurrentUsers(usersIncrement)
|
||||
.times(steps)
|
||||
.eachLevelLasting(stepDuration.seconds)
|
||||
.separatedByRampsLasting(rampDuration.seconds)
|
||||
.startingFrom(startUsers)
|
||||
)
|
||||
}: _*
|
||||
).protocols(httpProtocol)
|
||||
}
|
||||
Reference in New Issue
Block a user