feat: NCS-64 Spike Test (#5)
This commit is contained in:
+4
-1
@@ -28,7 +28,10 @@ tasks.withType(io.gatling.gradle.GatlingRunTask) {
|
||||
"-Dsteps=${findProperty('steps') ?: '2'}",
|
||||
"-DstepDuration=${findProperty('stepDuration') ?: '30'}",
|
||||
"-DconcurrentUsers=${findProperty('concurrentUsers') ?: '3'}",
|
||||
"-Dduration=${findProperty('duration') ?: '300'}"
|
||||
"-Dduration=${findProperty('duration') ?: '300'}",
|
||||
"-DbaselineUsers=${findProperty('baselineUsers') ?: '2'}",
|
||||
"-DbaselineDuration=${findProperty('baselineDuration') ?: '20'}",
|
||||
"-DspikeUsers=${findProperty('spikeUsers') ?: '15'}"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user