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
This commit was merged in pull request #3.
This commit is contained in:
+5
-1
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user