Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 99ea686ed5 |
+4
-2
@@ -23,8 +23,10 @@ tasks.withType(io.gatling.gradle.GatlingRunTask) {
|
|||||||
"-Dhealthz.path=${findProperty('healthzPath') ?: '/health'}",
|
"-Dhealthz.path=${findProperty('healthzPath') ?: '/health'}",
|
||||||
"-DmaxUsers=${findProperty('maxUsers') ?: '10'}",
|
"-DmaxUsers=${findProperty('maxUsers') ?: '10'}",
|
||||||
"-DrampDuration=${findProperty('rampDuration') ?: '60'}",
|
"-DrampDuration=${findProperty('rampDuration') ?: '60'}",
|
||||||
"-DconcurrentUsers=${findProperty('concurrentUsers') ?: '3'}",
|
"-DstartUsers=${findProperty('startUsers') ?: '2'}",
|
||||||
"-Dduration=${findProperty('duration') ?: '300'}"
|
"-DusersIncrement=${findProperty('usersIncrement') ?: '2'}",
|
||||||
|
"-Dsteps=${findProperty('steps') ?: '2'}",
|
||||||
|
"-DstepDuration=${findProperty('stepDuration') ?: '30'}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ object BoardEndpoints {
|
|||||||
|
|
||||||
val createGame: Endpoint = Endpoint(
|
val createGame: Endpoint = Endpoint(
|
||||||
name = "Create Game",
|
name = "Create Game",
|
||||||
method = "GET",
|
method = "POST",
|
||||||
path = "/api/account/official-bots/",
|
path = "/api/board/game/",
|
||||||
// expectedStatus = 200
|
expectedStatus = 201
|
||||||
)
|
)
|
||||||
|
|
||||||
val all: List[Endpoint] = List(createGame)
|
val all: List[Endpoint] = List(createGame)
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
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 {
|
class LoadTestSimulation extends BaseSimulation {
|
||||||
|
|
||||||
private val maxUsers = sys.props.getOrElse("maxUsers", "10").toInt
|
private val maxUsers = sys.props.getOrElse("maxUsers", "5").toInt
|
||||||
private val rampDuration = sys.props.getOrElse("rampDuration", "60").toInt
|
private val rampDuration = sys.props.getOrElse("rampDuration", "60").toInt
|
||||||
|
|
||||||
setUp(
|
setUp(
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
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