feat: NCS-60 Stress Test #3
+5
-1
@@ -22,7 +22,11 @@ tasks.withType(io.gatling.gradle.GatlingRunTask) {
|
|||||||
"-Dgatling.authToken=${findProperty('authToken') ?: System.getenv('GATLING_AUTH_TOKEN') ?: ''}",
|
"-Dgatling.authToken=${findProperty('authToken') ?: System.getenv('GATLING_AUTH_TOKEN') ?: ''}",
|
||||||
"-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'}",
|
||||||
|
"-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 {
|
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