feat: NCS-60 Stress Test #3

Merged
lq64 merged 2 commits from feat/NCS-60 into main 2026-05-05 17:09:43 +02:00
3 changed files with 35 additions and 2 deletions
+5 -1
View File
@@ -22,7 +22,11 @@ tasks.withType(io.gatling.gradle.GatlingRunTask) {
"-Dgatling.authToken=${findProperty('authToken') ?: System.getenv('GATLING_AUTH_TOKEN') ?: ''}",
"-Dhealthz.path=${findProperty('healthzPath') ?: '/health'}",
"-DmaxUsers=${findProperty('maxUsers') ?: '10'}",
"-DrampDuration=${findProperty('rampDuration') ?: '60'}"
"-DrampDuration=${findProperty('rampDuration') ?: '60'}",
"-DstartUsers=${findProperty('startUsers') ?: '2'}",
"-DusersIncrement=${findProperty('usersIncrement') ?: '2'}",
"-Dsteps=${findProperty('steps') ?: '2'}",
"-DstepDuration=${findProperty('stepDuration') ?: '30'}"
]
}
@@ -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)
}