Skip to content

Commit

Permalink
Adjust load-test
Browse files Browse the repository at this point in the history
  • Loading branch information
luechtdiode committed Jan 1, 2024
1 parent a3d8c4b commit e445d04
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<logger name="slick.jdbc" level="INFO"/>
<!-- uncomment and set to DEBUG to log all failing HTTP requests -->
<!-- uncomment and set to TRACE to log all HTTP requests -->
<logger name="io.gatling.http.engine.response" level="DEBUG" />
<logger name="io.netty.handler" level="INFO" />
<logger name="io.gatling.http.engine.response" level="INFO" />
<logger name="io.gatling" level="WARN" />
<logger name="ch.seidel.kutu.akka" level="WARN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SimulationBottmingenD1 extends Simulation {

val httpProtocol = http
.baseUrl(originBaseUrl)
.wsBaseUrl(originBaseUrl.replace("http", "ws")).wsReconnect.wsMaxReconnects(100000)
.wsBaseUrl(originBaseUrl.replace("http", "ws")).wsReconnect.wsMaxReconnects(10)
.inferHtmlResources()
.doNotTrackHeader("1")
.userAgentHeader("Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1")
Expand Down Expand Up @@ -112,9 +112,14 @@ class SimulationBottmingenD1 extends Simulation {
.set("sessionUserId", session.userId)
}

val diveToWertungen = exec(session => chooseDurchgang(session))
.exec(session => chooseGeraet(chooseDurchgangWSConnection(session)))
//.exec(connectWSUserToDurchgang)
val commonDGInitializer = exec(session => {
val dgSession = chooseDurchgang(session)
val dgwsSession = chooseDurchgangWSConnection(dgSession)
val gearSession = chooseGeraet(dgwsSession)
gearSession
})

val diveToWertungen = commonDGInitializer
.exec(connectWSUserToAll)
.exec(getSteps)
.foreach("${steps}", "step") {
Expand All @@ -129,7 +134,7 @@ class SimulationBottmingenD1 extends Simulation {
// implicit closed by session ending .exec(closeWSUserFromAll)
// implicit closed by session ending .exec(closeWSUserFromDurchgang)

val collectWertungen = diveToWertungen
val collectWertungen = commonDGInitializer
.exec(http(s"start durchgang")
.post(s"/api/competition/$competition/start")
.body(StringBody(s"""{"type":"StartDurchgangStation","wettkampfUUID":"$competition","durchgang":"${"${durchgangOriginal}"}"}""")))
Expand Down Expand Up @@ -178,13 +183,17 @@ class SimulationBottmingenD1 extends Simulation {
.exec(BrowseResults.loadAndSaveDurchgaenge)
.exec(BrowseResults.loadAndSaveGeraete)
.exec(BrowseResults.diveToWertungen)
.exec(BrowseResults.closeWSUserFromAll)


// https://mwclearning.com/?p=1678
// https://github.com/llatinov/sample-performance-with-gatling/
// https://automationrhapsody.com/performance-testing-with-gatling-integration-with-maven/
val scnJudge = scenario("Judge")
.exec(BrowseResults.loadAndSaveDurchgaenge)
.exec(BrowseResults.loadAndSaveGeraete)
.exec(BrowseResults.collectWertungen)
.exec(BrowseResults.closeWSUserFromDurchgang)

setUp(
scnVisitor
Expand All @@ -196,7 +205,7 @@ class SimulationBottmingenD1 extends Simulation {
)
.throttle(
reachRps(30) in (10 seconds),
holdFor(4 hours)
holdFor(1 hours)
)
,
scnJudge
Expand All @@ -214,8 +223,8 @@ class SimulationBottmingenD1 extends Simulation {
// heavisideUsers(20) during (60 seconds)
)
.throttle(
reachRps(10) in (30 minutes),
holdFor(30 minutes)
reachRps(5) in (3 minutes),
holdFor(1 hour)
)
).protocols(httpProtocol)
}

0 comments on commit e445d04

Please sign in to comment.