Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7981cb2e08 | |||
| 39af3b9f18 | |||
| 99ea686ed5 | |||
| 49b6a148ce |
+8
-1
@@ -23,8 +23,15 @@ 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'}",
|
||||||
|
"-DstartUsers=${findProperty('startUsers') ?: '2'}",
|
||||||
|
"-DusersIncrement=${findProperty('usersIncrement') ?: '2'}",
|
||||||
|
"-Dsteps=${findProperty('steps') ?: '2'}",
|
||||||
|
"-DstepDuration=${findProperty('stepDuration') ?: '30'}",
|
||||||
"-DconcurrentUsers=${findProperty('concurrentUsers') ?: '3'}",
|
"-DconcurrentUsers=${findProperty('concurrentUsers') ?: '3'}",
|
||||||
"-Dduration=${findProperty('duration') ?: '300'}"
|
"-Dduration=${findProperty('duration') ?: '300'}",
|
||||||
|
"-DbaselineUsers=${findProperty('baselineUsers') ?: '2'}",
|
||||||
|
"-DbaselineDuration=${findProperty('baselineDuration') ?: '20'}",
|
||||||
|
"-DspikeUsers=${findProperty('spikeUsers') ?: '15'}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,26 @@
|
|||||||
|
package simulations
|
||||||
|
|
||||||
|
import base.BaseSimulation
|
||||||
|
import endpoints.BoardEndpoints
|
||||||
|
import io.gatling.core.Predef._
|
||||||
|
|
||||||
|
import scala.concurrent.duration._
|
||||||
|
|
||||||
|
class SpikeTestSimulation extends BaseSimulation {
|
||||||
|
|
||||||
|
private val baselineUsers = sys.props.getOrElse("baselineUsers", "2").toInt
|
||||||
|
private val baselineDuration = sys.props.getOrElse("baselineDuration", "20").toInt
|
||||||
|
private val spikeUsers = sys.props.getOrElse("spikeUsers", "15").toInt
|
||||||
|
|
||||||
|
setUp(
|
||||||
|
BoardEndpoints.all.map { endpoint =>
|
||||||
|
scenarioFromEndpoint(endpoint)
|
||||||
|
.inject(
|
||||||
|
constantUsersPerSec(baselineUsers).during(baselineDuration.seconds),
|
||||||
|
atOnceUsers(spikeUsers),
|
||||||
|
nothingFor(5.seconds),
|
||||||
|
constantUsersPerSec(baselineUsers).during(baselineDuration.seconds)
|
||||||
|
)
|
||||||
|
}: _*
|
||||||
|
).protocols(httpProtocol)
|
||||||
|
}
|
||||||
@@ -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