4 Commits

Author SHA1 Message Date
LQ63 7981cb2e08 feat: NCS-64 Spike Test (#5) 2026-05-05 17:15:22 +02:00
LQ63 39af3b9f18 feat: NCS-62 Endurance Test (#4) 2026-05-05 17:14:58 +02:00
lq64 99ea686ed5 feat: NCS-60 Stress Test (#3)
Added a stress test and configured the parameters to simulate a smaller load

---------

Co-authored-by: LQ63 <lkhermann@web.de>
Reviewed-on: #3
2026-05-05 17:09:42 +02:00
LQ63 9b97fa6e34 feat(Gatlin): Endurance Test
Added an endurance test and changed endpoint to a more stable one
2026-05-04 15:45:44 +02:00
5 changed files with 61 additions and 4 deletions
+6
View File
@@ -23,6 +23,12 @@ 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'}",
"-DbaselineUsers=${findProperty('baselineUsers') ?: '2'}",
"-DbaselineDuration=${findProperty('baselineDuration') ?: '20'}",
"-DspikeUsers=${findProperty('spikeUsers') ?: '15'}"
@@ -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", "10").toInt
private val maxUsers = sys.props.getOrElse("maxUsers", "5").toInt
private val rampDuration = sys.props.getOrElse("rampDuration", "60").toInt
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)
}