feat: NCS-64 Spike Test #5
+4
-1
@@ -22,7 +22,10 @@ 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'}",
|
||||||
|
"-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