From 299c802e6cee3ce5486921d949e5f7b53b2dc161 Mon Sep 17 00:00:00 2001 From: ErdemYabaci Date: Fri, 19 Apr 2024 19:51:28 +0200 Subject: [PATCH 01/11] first scala file. Tries to add users --- webapp/load_tests/AddUserTest.scala | 101 ++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 webapp/load_tests/AddUserTest.scala diff --git a/webapp/load_tests/AddUserTest.scala b/webapp/load_tests/AddUserTest.scala new file mode 100644 index 00000000..c2ae2702 --- /dev/null +++ b/webapp/load_tests/AddUserTest.scala @@ -0,0 +1,101 @@ + +import scala.concurrent.duration._ + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.jdbc.Predef._ + +class AddUserTest extends Simulation { + + private val httpProtocol = http + .baseUrl("http://localhost:8000") + .inferHtmlResources() + .acceptHeader("image/avif,image/webp,*/*") + .acceptEncodingHeader("gzip, deflate") + .acceptLanguageHeader("en-US,en;q=0.5") + .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0") + + private val headers_0 = Map( + "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", + "If-None-Match" -> """"80bbd9aaa77c6ab13ddbfd8b99907359d61d5599"""", + "Upgrade-Insecure-Requests" -> "1" + ) + + private val headers_1 = Map( + "Accept" -> "*/*", + "If-None-Match" -> """"4eb24268e14d36ab09807a0bb681be35749ce622"""" + ) + + private val headers_2 = Map( + "Accept" -> "text/css,*/*;q=0.1", + "If-None-Match" -> """"7d9af05715904e0e3cfa4a4f9652b7cfbb93228a"""" + ) + + private val headers_3 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") + + private val headers_4 = Map("If-None-Match" -> """"65ee095e47921eb3939c327551323d2160b957d0"""") + + private val headers_5 = Map("If-None-Match" -> """"65ec1acbd922addd29cfa24a8bb6eba228e9762b"""") + + private val headers_6 = Map("If-None-Match" -> """"c50d19d0c435eda46d13e78270d4836236358229"""") + + private val headers_7 = Map("If-None-Match" -> """"d1ac1507d79525e81a1f0c8dbf66acc65af43b05"""") + + private val headers_8 = Map( + "Accept" -> "*/*", + "Access-Control-Request-Headers" -> "content-type", + "Access-Control-Request-Method" -> "POST", + "Origin" -> "http://localhost:3000" + ) + + private val headers_9 = Map( + "Accept" -> "application/json, text/plain, */*", + "Content-Type" -> "application/json", + "Origin" -> "http://localhost:3000" + ) + + private val uri1 = "localhost" + + private val scn = scenario("AddUserTest") + .exec( + http("request_0") + .get("http://" + uri1 + ":3000/") + .headers(headers_0) + .resources( + http("request_1") + .get("http://" + uri1 + ":3000/static/js/main.20248e22.js") + .headers(headers_1), + http("request_2") + .get("http://" + uri1 + ":3000/static/css/main.56b4d383.css") + .headers(headers_2), + http("request_3") + .get("http://" + uri1 + ":3000/help.png") + .headers(headers_3), + http("request_4") + .get("http://" + uri1 + ":3000/logo.jpg") + .headers(headers_4), + http("request_5") + .get("http://" + uri1 + ":3000/login.png") + .headers(headers_5), + http("request_6") + .get("http://" + uri1 + ":3000/instrucciones.png") + .headers(headers_6), + http("request_7") + .get("http://" + uri1 + ":3000/signup.png") + .headers(headers_7) + ), + pause(11), + http("request_8") + .options("/adduser") + .headers(headers_8) + .resources( + http("request_9") + .post("/adduser") + .headers(headers_9) + .body(RawFileBody("addusertest/0009_request.json")) + .check(status.is(400)) + ) + ) + + setUp(scn.inject(atOnceUsers(50))).protocols(httpProtocol) +} From 0f4531f5fb3e89db49997e50e02bf9fd1be5f2bd Mon Sep 17 00:00:00 2001 From: ErdemYabaci Date: Sun, 21 Apr 2024 17:39:10 +0200 Subject: [PATCH 02/11] Logintest --- webapp/load_tests/LoginTest.scala | 100 ++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 webapp/load_tests/LoginTest.scala diff --git a/webapp/load_tests/LoginTest.scala b/webapp/load_tests/LoginTest.scala new file mode 100644 index 00000000..db11d3ec --- /dev/null +++ b/webapp/load_tests/LoginTest.scala @@ -0,0 +1,100 @@ + +import scala.concurrent.duration._ + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.jdbc.Predef._ + +class LoginTest extends Simulation { + + private val httpProtocol = http + .baseUrl("http://20.123.43.37:8000") + .inferHtmlResources() + .acceptHeader("image/avif,image/webp,*/*") + .acceptEncodingHeader("gzip, deflate") + .acceptLanguageHeader("en-US,en;q=0.5") + .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0") + + private val headers_0 = Map( + "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", + "If-None-Match" -> """"b5d501da5a087cfc56cf16f4dcaf265ff4cc7e32"""", + "Upgrade-Insecure-Requests" -> "1" + ) + + private val headers_1 = Map( + "Accept" -> "*/*", + "If-None-Match" -> """"4542ad76d29dc661cacea47c79ceaaffba95765b"""" + ) + + private val headers_2 = Map( + "Accept" -> "text/css,*/*;q=0.1", + "If-None-Match" -> """"2cf07eee53619a3b1ac676a4c66ca7db7ee3f311"""" + ) + + private val headers_3 = Map("If-None-Match" -> """"65ee095e47921eb3939c327551323d2160b957d0"""") + + private val headers_4 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") + + private val headers_5 = Map("If-None-Match" -> """"65ec1acbd922addd29cfa24a8bb6eba228e9762b"""") + + private val headers_6 = Map("If-None-Match" -> """"c50d19d0c435eda46d13e78270d4836236358229"""") + + private val headers_7 = Map("If-None-Match" -> """"d1ac1507d79525e81a1f0c8dbf66acc65af43b05"""") + + private val headers_8 = Map( + "Accept" -> "*/*", + "Access-Control-Request-Headers" -> "content-type", + "Access-Control-Request-Method" -> "POST", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_9 = Map( + "Accept" -> "application/json, text/plain, */*", + "Content-Type" -> "application/json", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val uri2 = "http://wiqen1b.serveminecraft.net:3000" + + private val scn = scenario("LoginTest") + .exec( + http("request_0") + .get(uri2 + "/home") + .headers(headers_0) + .resources( + http("request_1") + .get(uri2 + "/static/js/main.1e24deb0.js") + .headers(headers_1), + http("request_2") + .get(uri2 + "/static/css/main.5d93e4f8.css") + .headers(headers_2), + http("request_3") + .get(uri2 + "/logo.jpg") + .headers(headers_3), + http("request_4") + .get(uri2 + "/help.png") + .headers(headers_4), + http("request_5") + .get(uri2 + "/login.png") + .headers(headers_5), + http("request_6") + .get(uri2 + "/instrucciones.png") + .headers(headers_6), + http("request_7") + .get(uri2 + "/signup.png") + .headers(headers_7) + ), + pause(18), + http("request_8") + .options("/login") + .headers(headers_8) + .resources( + http("request_9") + .post("/login") + .headers(headers_9) + .body(RawFileBody("logintest/0009_request.json")) + ) + ) + + setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol) +} From 3a616c90d55ea5fdd6d2d3d2e66fe4cde4221b40 Mon Sep 17 00:00:00 2001 From: ErdemYabaci Date: Sun, 21 Apr 2024 17:48:27 +0200 Subject: [PATCH 03/11] playtest for testing the game --- webapp/load_tests/PlayTest.scala | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 webapp/load_tests/PlayTest.scala diff --git a/webapp/load_tests/PlayTest.scala b/webapp/load_tests/PlayTest.scala new file mode 100644 index 00000000..85645a69 --- /dev/null +++ b/webapp/load_tests/PlayTest.scala @@ -0,0 +1,54 @@ + +import scala.concurrent.duration._ + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.jdbc.Predef._ + +class PlayTest extends Simulation { + + private val httpProtocol = http + .baseUrl("http://20.123.43.37:8000") + .inferHtmlResources() + .acceptHeader("image/avif,image/webp,*/*") + .acceptEncodingHeader("gzip, deflate") + .acceptLanguageHeader("en-US,en;q=0.5") + .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0") + + private val headers_0 = Map( + "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", + "Upgrade-Insecure-Requests" -> "1" + ) + + private val headers_1 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") + + private val headers_2 = Map("If-None-Match" -> """"65ee095e47921eb3939c327551323d2160b957d0"""") + + private val headers_3 = Map( + "Accept" -> "application/json, text/plain, */*", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val uri2 = "http://wiqen1b.serveminecraft.net:3000" + + private val scn = scenario("PlayTest") + .exec( + http("request_0") + .get(uri2 + "/menu") + .headers(headers_0) + .resources( + http("request_1") + .get(uri2 + "/help.png") + .headers(headers_1), + http("request_2") + .get(uri2 + "/logo.jpg") + .headers(headers_2) + ), + pause(1), + http("request_3") + .get("/questions/en") + .headers(headers_3) + ) + + setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol) +} From 6de88f972b868c95bd059c96f810cbe72788599e Mon Sep 17 00:00:00 2001 From: ErdemYabaci Date: Sun, 21 Apr 2024 18:14:22 +0200 Subject: [PATCH 04/11] replacement for adduser using the website now instead of localhost --- webapp/load_tests/AddUserTest.scala | 69 ++++++++++------------------- 1 file changed, 24 insertions(+), 45 deletions(-) diff --git a/webapp/load_tests/AddUserTest.scala b/webapp/load_tests/AddUserTest.scala index c2ae2702..29e917e1 100644 --- a/webapp/load_tests/AddUserTest.scala +++ b/webapp/load_tests/AddUserTest.scala @@ -8,94 +8,73 @@ import io.gatling.jdbc.Predef._ class AddUserTest extends Simulation { private val httpProtocol = http - .baseUrl("http://localhost:8000") + .baseUrl("http://20.123.43.37:8000") .inferHtmlResources() .acceptHeader("image/avif,image/webp,*/*") .acceptEncodingHeader("gzip, deflate") .acceptLanguageHeader("en-US,en;q=0.5") - .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0") + .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0") private val headers_0 = Map( "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", - "If-None-Match" -> """"80bbd9aaa77c6ab13ddbfd8b99907359d61d5599"""", "Upgrade-Insecure-Requests" -> "1" ) - private val headers_1 = Map( - "Accept" -> "*/*", - "If-None-Match" -> """"4eb24268e14d36ab09807a0bb681be35749ce622"""" - ) + private val headers_2 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") - private val headers_2 = Map( - "Accept" -> "text/css,*/*;q=0.1", - "If-None-Match" -> """"7d9af05715904e0e3cfa4a4f9652b7cfbb93228a"""" - ) + private val headers_3 = Map("If-None-Match" -> """"c50d19d0c435eda46d13e78270d4836236358229"""") - private val headers_3 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") - - private val headers_4 = Map("If-None-Match" -> """"65ee095e47921eb3939c327551323d2160b957d0"""") + private val headers_4 = Map("If-None-Match" -> """"d1ac1507d79525e81a1f0c8dbf66acc65af43b05"""") private val headers_5 = Map("If-None-Match" -> """"65ec1acbd922addd29cfa24a8bb6eba228e9762b"""") - private val headers_6 = Map("If-None-Match" -> """"c50d19d0c435eda46d13e78270d4836236358229"""") - - private val headers_7 = Map("If-None-Match" -> """"d1ac1507d79525e81a1f0c8dbf66acc65af43b05"""") - - private val headers_8 = Map( + private val headers_6 = Map( "Accept" -> "*/*", "Access-Control-Request-Headers" -> "content-type", "Access-Control-Request-Method" -> "POST", - "Origin" -> "http://localhost:3000" + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" ) - private val headers_9 = Map( + private val headers_7 = Map( "Accept" -> "application/json, text/plain, */*", "Content-Type" -> "application/json", - "Origin" -> "http://localhost:3000" + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" ) - private val uri1 = "localhost" + private val uri2 = "http://wiqen1b.serveminecraft.net:3000" private val scn = scenario("AddUserTest") .exec( http("request_0") - .get("http://" + uri1 + ":3000/") + .get(uri2 + "/home") .headers(headers_0) .resources( http("request_1") - .get("http://" + uri1 + ":3000/static/js/main.20248e22.js") - .headers(headers_1), + .get(uri2 + "/logo.jpg"), http("request_2") - .get("http://" + uri1 + ":3000/static/css/main.56b4d383.css") + .get(uri2 + "/help.png") .headers(headers_2), http("request_3") - .get("http://" + uri1 + ":3000/help.png") + .get(uri2 + "/instrucciones.png") .headers(headers_3), http("request_4") - .get("http://" + uri1 + ":3000/logo.jpg") + .get(uri2 + "/signup.png") .headers(headers_4), http("request_5") - .get("http://" + uri1 + ":3000/login.png") - .headers(headers_5), - http("request_6") - .get("http://" + uri1 + ":3000/instrucciones.png") - .headers(headers_6), - http("request_7") - .get("http://" + uri1 + ":3000/signup.png") - .headers(headers_7) + .get(uri2 + "/login.png") + .headers(headers_5) ), - pause(11), - http("request_8") + pause(17), + http("request_6") .options("/adduser") - .headers(headers_8) + .headers(headers_6) .resources( - http("request_9") + http("request_7") .post("/adduser") - .headers(headers_9) - .body(RawFileBody("addusertest/0009_request.json")) - .check(status.is(400)) + .headers(headers_7) + .body(RawFileBody("addusertest/0007_request.json")) ) ) - setUp(scn.inject(atOnceUsers(50))).protocols(httpProtocol) + setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol) } From 793c6217bb701c420864c11aa8f42de362d2a36d Mon Sep 17 00:00:00 2001 From: ErdemYabaci Date: Sat, 27 Apr 2024 18:22:49 +0200 Subject: [PATCH 05/11] deletion of old scala files since login/register changed --- webapp/load_tests/AddUserTest.scala | 80 ---------------------- webapp/load_tests/LoginTest.scala | 100 ---------------------------- webapp/load_tests/PlayTest.scala | 54 --------------- 3 files changed, 234 deletions(-) delete mode 100644 webapp/load_tests/AddUserTest.scala delete mode 100644 webapp/load_tests/LoginTest.scala delete mode 100644 webapp/load_tests/PlayTest.scala diff --git a/webapp/load_tests/AddUserTest.scala b/webapp/load_tests/AddUserTest.scala deleted file mode 100644 index 29e917e1..00000000 --- a/webapp/load_tests/AddUserTest.scala +++ /dev/null @@ -1,80 +0,0 @@ - -import scala.concurrent.duration._ - -import io.gatling.core.Predef._ -import io.gatling.http.Predef._ -import io.gatling.jdbc.Predef._ - -class AddUserTest extends Simulation { - - private val httpProtocol = http - .baseUrl("http://20.123.43.37:8000") - .inferHtmlResources() - .acceptHeader("image/avif,image/webp,*/*") - .acceptEncodingHeader("gzip, deflate") - .acceptLanguageHeader("en-US,en;q=0.5") - .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0") - - private val headers_0 = Map( - "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", - "Upgrade-Insecure-Requests" -> "1" - ) - - private val headers_2 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") - - private val headers_3 = Map("If-None-Match" -> """"c50d19d0c435eda46d13e78270d4836236358229"""") - - private val headers_4 = Map("If-None-Match" -> """"d1ac1507d79525e81a1f0c8dbf66acc65af43b05"""") - - private val headers_5 = Map("If-None-Match" -> """"65ec1acbd922addd29cfa24a8bb6eba228e9762b"""") - - private val headers_6 = Map( - "Accept" -> "*/*", - "Access-Control-Request-Headers" -> "content-type", - "Access-Control-Request-Method" -> "POST", - "Origin" -> "http://wiqen1b.serveminecraft.net:3000" - ) - - private val headers_7 = Map( - "Accept" -> "application/json, text/plain, */*", - "Content-Type" -> "application/json", - "Origin" -> "http://wiqen1b.serveminecraft.net:3000" - ) - - private val uri2 = "http://wiqen1b.serveminecraft.net:3000" - - private val scn = scenario("AddUserTest") - .exec( - http("request_0") - .get(uri2 + "/home") - .headers(headers_0) - .resources( - http("request_1") - .get(uri2 + "/logo.jpg"), - http("request_2") - .get(uri2 + "/help.png") - .headers(headers_2), - http("request_3") - .get(uri2 + "/instrucciones.png") - .headers(headers_3), - http("request_4") - .get(uri2 + "/signup.png") - .headers(headers_4), - http("request_5") - .get(uri2 + "/login.png") - .headers(headers_5) - ), - pause(17), - http("request_6") - .options("/adduser") - .headers(headers_6) - .resources( - http("request_7") - .post("/adduser") - .headers(headers_7) - .body(RawFileBody("addusertest/0007_request.json")) - ) - ) - - setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol) -} diff --git a/webapp/load_tests/LoginTest.scala b/webapp/load_tests/LoginTest.scala deleted file mode 100644 index db11d3ec..00000000 --- a/webapp/load_tests/LoginTest.scala +++ /dev/null @@ -1,100 +0,0 @@ - -import scala.concurrent.duration._ - -import io.gatling.core.Predef._ -import io.gatling.http.Predef._ -import io.gatling.jdbc.Predef._ - -class LoginTest extends Simulation { - - private val httpProtocol = http - .baseUrl("http://20.123.43.37:8000") - .inferHtmlResources() - .acceptHeader("image/avif,image/webp,*/*") - .acceptEncodingHeader("gzip, deflate") - .acceptLanguageHeader("en-US,en;q=0.5") - .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0") - - private val headers_0 = Map( - "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", - "If-None-Match" -> """"b5d501da5a087cfc56cf16f4dcaf265ff4cc7e32"""", - "Upgrade-Insecure-Requests" -> "1" - ) - - private val headers_1 = Map( - "Accept" -> "*/*", - "If-None-Match" -> """"4542ad76d29dc661cacea47c79ceaaffba95765b"""" - ) - - private val headers_2 = Map( - "Accept" -> "text/css,*/*;q=0.1", - "If-None-Match" -> """"2cf07eee53619a3b1ac676a4c66ca7db7ee3f311"""" - ) - - private val headers_3 = Map("If-None-Match" -> """"65ee095e47921eb3939c327551323d2160b957d0"""") - - private val headers_4 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") - - private val headers_5 = Map("If-None-Match" -> """"65ec1acbd922addd29cfa24a8bb6eba228e9762b"""") - - private val headers_6 = Map("If-None-Match" -> """"c50d19d0c435eda46d13e78270d4836236358229"""") - - private val headers_7 = Map("If-None-Match" -> """"d1ac1507d79525e81a1f0c8dbf66acc65af43b05"""") - - private val headers_8 = Map( - "Accept" -> "*/*", - "Access-Control-Request-Headers" -> "content-type", - "Access-Control-Request-Method" -> "POST", - "Origin" -> "http://wiqen1b.serveminecraft.net:3000" - ) - - private val headers_9 = Map( - "Accept" -> "application/json, text/plain, */*", - "Content-Type" -> "application/json", - "Origin" -> "http://wiqen1b.serveminecraft.net:3000" - ) - - private val uri2 = "http://wiqen1b.serveminecraft.net:3000" - - private val scn = scenario("LoginTest") - .exec( - http("request_0") - .get(uri2 + "/home") - .headers(headers_0) - .resources( - http("request_1") - .get(uri2 + "/static/js/main.1e24deb0.js") - .headers(headers_1), - http("request_2") - .get(uri2 + "/static/css/main.5d93e4f8.css") - .headers(headers_2), - http("request_3") - .get(uri2 + "/logo.jpg") - .headers(headers_3), - http("request_4") - .get(uri2 + "/help.png") - .headers(headers_4), - http("request_5") - .get(uri2 + "/login.png") - .headers(headers_5), - http("request_6") - .get(uri2 + "/instrucciones.png") - .headers(headers_6), - http("request_7") - .get(uri2 + "/signup.png") - .headers(headers_7) - ), - pause(18), - http("request_8") - .options("/login") - .headers(headers_8) - .resources( - http("request_9") - .post("/login") - .headers(headers_9) - .body(RawFileBody("logintest/0009_request.json")) - ) - ) - - setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol) -} diff --git a/webapp/load_tests/PlayTest.scala b/webapp/load_tests/PlayTest.scala deleted file mode 100644 index 85645a69..00000000 --- a/webapp/load_tests/PlayTest.scala +++ /dev/null @@ -1,54 +0,0 @@ - -import scala.concurrent.duration._ - -import io.gatling.core.Predef._ -import io.gatling.http.Predef._ -import io.gatling.jdbc.Predef._ - -class PlayTest extends Simulation { - - private val httpProtocol = http - .baseUrl("http://20.123.43.37:8000") - .inferHtmlResources() - .acceptHeader("image/avif,image/webp,*/*") - .acceptEncodingHeader("gzip, deflate") - .acceptLanguageHeader("en-US,en;q=0.5") - .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0") - - private val headers_0 = Map( - "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", - "Upgrade-Insecure-Requests" -> "1" - ) - - private val headers_1 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") - - private val headers_2 = Map("If-None-Match" -> """"65ee095e47921eb3939c327551323d2160b957d0"""") - - private val headers_3 = Map( - "Accept" -> "application/json, text/plain, */*", - "Origin" -> "http://wiqen1b.serveminecraft.net:3000" - ) - - private val uri2 = "http://wiqen1b.serveminecraft.net:3000" - - private val scn = scenario("PlayTest") - .exec( - http("request_0") - .get(uri2 + "/menu") - .headers(headers_0) - .resources( - http("request_1") - .get(uri2 + "/help.png") - .headers(headers_1), - http("request_2") - .get(uri2 + "/logo.jpg") - .headers(headers_2) - ), - pause(1), - http("request_3") - .get("/questions/en") - .headers(headers_3) - ) - - setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol) -} From 184adc87c4ea33f3c06641a98c199d1953239dd1 Mon Sep 17 00:00:00 2001 From: ErdemYabaci Date: Sat, 27 Apr 2024 18:23:51 +0200 Subject: [PATCH 06/11] new load test for logging in, playing, seeing historical data and logging out. --- webapp/load_tests/LoginTest.scala | 245 ++++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 webapp/load_tests/LoginTest.scala diff --git a/webapp/load_tests/LoginTest.scala b/webapp/load_tests/LoginTest.scala new file mode 100644 index 00000000..42cb6d71 --- /dev/null +++ b/webapp/load_tests/LoginTest.scala @@ -0,0 +1,245 @@ + +import scala.concurrent.duration._ + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.jdbc.Predef._ + +class LoginTest extends Simulation { + + private val httpProtocol = http + .baseUrl("http://wiqen1b.serveminecraft.net:3000") + .inferHtmlResources() + .acceptHeader("image/avif,image/webp,*/*") + .acceptEncodingHeader("gzip, deflate") + .acceptLanguageHeader("en-US,en;q=0.5") + .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0") + + private val headers_0 = Map( + "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", + "If-None-Match" -> """"23cd247262374aa9f354f287be15b227be4ffdc8"""", + "Upgrade-Insecure-Requests" -> "1" + ) + + private val headers_1 = Map( + "Accept" -> "*/*", + "If-None-Match" -> """"0d9319e48bb9c6299e791d37bf623f9351ccefa1"""" + ) + + private val headers_2 = Map( + "Accept" -> "text/css,*/*;q=0.1", + "If-None-Match" -> """"1c5e40f1aec9aa27ef4094814fa3bcfd75d36c7e"""" + ) + + private val headers_3 = Map("If-None-Match" -> """"65ee095e47921eb3939c327551323d2160b957d0"""") + + private val headers_4 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") + + private val headers_5 = Map("If-None-Match" -> """"d1ac1507d79525e81a1f0c8dbf66acc65af43b05"""") + + private val headers_6 = Map("If-None-Match" -> """"65ec1acbd922addd29cfa24a8bb6eba228e9762b"""") + + private val headers_7 = Map("If-None-Match" -> """"c50d19d0c435eda46d13e78270d4836236358229"""") + + private val headers_8 = Map( + "Accept" -> "*/*", + "Access-Control-Request-Headers" -> "content-type", + "Access-Control-Request-Method" -> "POST", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_9 = Map( + "Accept" -> "application/json, text/plain, */*", + "Content-Type" -> "application/json", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_15 = Map( + "Accept" -> "*/*", + "Access-Control-Request-Headers" -> "token", + "Access-Control-Request-Method" -> "GET", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_16 = Map( + "Accept" -> "application/json, text/plain, */*", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000", + "token" -> "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NjJkMjA0MTRkMDY2NjE0OGZkMDA3ZDIiLCJpYXQiOjE3MTQyMzM0MzksImV4cCI6MTcxNDIzNzAzOX0.MPgFSRGxoXlTmi8Tfe8ZWYSXQkCrqnVI3c80w7BEbbs" + ) + + private val headers_17 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "Range" -> "bytes=0-" + ) + + private val headers_21 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "If-None-Match" -> """"c2dc612cee2618539cc80edc7e71982b39d16900"""", + "Range" -> "bytes=0-" + ) + + private val headers_22 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "If-None-Match" -> """"ede98d89d2ac6ceec41bf22df94c4f8deaa5490e"""", + "Range" -> "bytes=0-" + ) + + private val headers_24 = Map( + "Accept" -> "*/*", + "Access-Control-Request-Headers" -> "content-type,token", + "Access-Control-Request-Method" -> "POST", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_25 = Map( + "Accept" -> "application/json, text/plain, */*", + "Content-Type" -> "application/json", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000", + "token" -> "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NjJkMjA0MTRkMDY2NjE0OGZkMDA3ZDIiLCJpYXQiOjE3MTQyMzM0MzksImV4cCI6MTcxNDIzNzAzOX0.MPgFSRGxoXlTmi8Tfe8ZWYSXQkCrqnVI3c80w7BEbbs" + ) + + private val uri2 = "http://20.123.45.199:8000" + + private val scn = scenario("LoginTest") + .exec( + http("request_0") + .get("/") + .headers(headers_0) + .resources( + http("request_1") + .get("/static/js/main.e5ae103b.js") + .headers(headers_1), + http("request_2") + .get("/static/css/main.ea46ba81.css") + .headers(headers_2), + http("request_3") + .get("/logo.jpg") + .headers(headers_3), + http("request_4") + .get("/help.png") + .headers(headers_4), + http("request_5") + .get("/signup.png") + .headers(headers_5), + http("request_6") + .get("/login.png") + .headers(headers_6), + http("request_7") + .get("/instrucciones.png") + .headers(headers_7) + ), + pause(7), + http("request_8") + .options(uri2 + "/login") + .headers(headers_8) + .resources( + http("request_9") + .post(uri2 + "/login") + .headers(headers_9) + .body(RawFileBody("logintest/0009_request.json")), + http("request_10") + .get("/menu") + .headers(headers_0), + http("request_11") + .get("/static/js/main.e5ae103b.js") + .headers(headers_1), + http("request_12") + .get("/static/css/main.ea46ba81.css") + .headers(headers_2), + http("request_13") + .get("/logo.jpg") + .headers(headers_3), + http("request_14") + .get("/help.png") + .headers(headers_4) + ), + pause(6), + http("request_15") + .options(uri2 + "/questions/en") + .headers(headers_15) + .resources( + http("request_16") + .get(uri2 + "/questions/en") + .headers(headers_16), + http("request_17") + .get("/tictac.mp3") + .headers(headers_17), + http("request_18") + .get("/tictac.mp3") + .headers(headers_17) + ), + pause(1), + http("request_19") + .get("/incorrect.mp3") + .headers(headers_17) + .resources( + http("request_20") + .get("/correct.mp3") + .headers(headers_17) + ), + pause(2), + http("request_21") + .get("/incorrect.mp3") + .headers(headers_21), + pause(3), + http("request_22") + .get("/correct.mp3") + .headers(headers_22) + .resources( + http("request_23") + .get("/incorrect.mp3") + .headers(headers_21) + ), + pause(2), + http("request_24") + .options(uri2 + "/record") + .headers(headers_24) + .resources( + http("request_25") + .post(uri2 + "/record") + .headers(headers_25) + .body(RawFileBody("logintest/0025_request.json")) + ), + pause(5), + http("request_26") + .options(uri2 + "/record/loadtest") + .headers(headers_15) + .resources( + http("request_27") + .get(uri2 + "/record/loadtest") + .headers(headers_16) + ), + pause(7), + http("request_28") + .get("/home") + .headers(headers_0) + .resources( + http("request_29") + .get("/static/js/main.e5ae103b.js") + .headers(headers_1), + http("request_30") + .get("/static/css/main.ea46ba81.css") + .headers(headers_2), + http("request_31") + .get("/help.png") + .headers(headers_4), + http("request_32") + .get("/logo.jpg") + .headers(headers_3), + http("request_33") + .get("/signup.png") + .headers(headers_5), + http("request_34") + .get("/login.png") + .headers(headers_6), + http("request_35") + .get("/instrucciones.png") + .headers(headers_7) + ) + ) + + setUp(scn.inject(constantUsersPerSec(2).during(10)).protocols(httpProtocol)) +} From b8bcd02efe0d818aae23d824d20a3f59acca1d0d Mon Sep 17 00:00:00 2001 From: ErdemYabaci Date: Sat, 27 Apr 2024 20:04:28 +0200 Subject: [PATCH 07/11] playtest with guest function with 600 users --- webapp/load_tests/GuestTest.scala | 138 ++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 webapp/load_tests/GuestTest.scala diff --git a/webapp/load_tests/GuestTest.scala b/webapp/load_tests/GuestTest.scala new file mode 100644 index 00000000..b20f1977 --- /dev/null +++ b/webapp/load_tests/GuestTest.scala @@ -0,0 +1,138 @@ + +import scala.concurrent.duration._ + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.jdbc.Predef._ + +class GuestTest extends Simulation { + + private val httpProtocol = http + .baseUrl("http://wiqen1b.serveminecraft.net:3000") + .inferHtmlResources() + .acceptHeader("image/avif,image/webp,*/*") + .acceptEncodingHeader("gzip, deflate") + .acceptLanguageHeader("en-US,en;q=0.5") + .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0") + + private val headers_0 = Map( + "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", + "If-None-Match" -> """"7fb8e46b93553a316e0f0797b662c57bad733dfe"""", + "Upgrade-Insecure-Requests" -> "1" + ) + + private val headers_1 = Map( + "Accept" -> "text/css,*/*;q=0.1", + "If-None-Match" -> """"1c5e40f1aec9aa27ef4094814fa3bcfd75d36c7e"""" + ) + + private val headers_2 = Map( + "Accept" -> "*/*", + "If-None-Match" -> """"5e5bb1e21cd7e4c4090b7468046fbbe5a4a36578"""" + ) + + private val headers_3 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") + + private val headers_4 = Map("If-None-Match" -> """"65ee095e47921eb3939c327551323d2160b957d0"""") + + private val headers_5 = Map("If-None-Match" -> """"86e23e6bf049be077067249dc086499dfde7620a"""") + + private val headers_6 = Map("If-None-Match" -> """"65ec1acbd922addd29cfa24a8bb6eba228e9762b"""") + + private val headers_7 = Map("If-None-Match" -> """"d1ac1507d79525e81a1f0c8dbf66acc65af43b05"""") + + private val headers_8 = Map( + "Accept" -> "*/*", + "Access-Control-Request-Headers" -> "token", + "Access-Control-Request-Method" -> "GET", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_9 = Map( + "Accept" -> "application/json, text/plain, */*", + "If-None-Match" -> """W/"211-eylKOmNwJm7M9mm/No1Pt93T4EA"""", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000", + "token" -> "" + ) + + private val headers_10 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "If-None-Match" -> """"c2dc612cee2618539cc80edc7e71982b39d16900"""", + "Range" -> "bytes=0-" + ) + + private val headers_11 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "If-None-Match" -> """"ede98d89d2ac6ceec41bf22df94c4f8deaa5490e"""", + "Range" -> "bytes=0-" + ) + + private val headers_12 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "Range" -> "bytes=0-" + ) + + private val uri2 = "http://20.123.45.199:8000/questions/en" + + private val scn = scenario("GuestTest") + .exec( + http("request_0") + .get("/") + .headers(headers_0) + .resources( + http("request_1") + .get("/static/css/main.ea46ba81.css") + .headers(headers_1), + http("request_2") + .get("/static/js/main.72c32461.js") + .headers(headers_2), + http("request_3") + .get("/help.png") + .headers(headers_3), + http("request_4") + .get("/logo.jpg") + .headers(headers_4), + http("request_5") + .get("/game.png") + .headers(headers_5), + http("request_6") + .get("/login.png") + .headers(headers_6), + http("request_7") + .get("/signup.png") + .headers(headers_7) + ), + pause(1), + http("request_8") + .options(uri2) + .headers(headers_8) + .resources( + http("request_9") + .get(uri2) + .headers(headers_9) + ), + pause(1), + http("request_10") + .get("/incorrect.mp3") + .headers(headers_10) + .resources( + http("request_11") + .get("/correct.mp3") + .headers(headers_11) + ), + pause(3), + http("request_12") + .get("/incorrect.mp3") + .headers(headers_12) + .resources( + http("request_13") + .get("/correct.mp3") + .headers(headers_12) + ) + ) + + setUp(scn.inject(constantUsersPerSec(10).during(60)).protocols(httpProtocol)) +} From 41d3bc1cfa509a016beaed4fa260a4161fb2345c Mon Sep 17 00:00:00 2001 From: ErdemYabaci Date: Sat, 27 Apr 2024 20:12:06 +0200 Subject: [PATCH 08/11] playtest with 1200 users --- webapp/load_tests/GuestTest2.scala | 138 +++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 webapp/load_tests/GuestTest2.scala diff --git a/webapp/load_tests/GuestTest2.scala b/webapp/load_tests/GuestTest2.scala new file mode 100644 index 00000000..083359bf --- /dev/null +++ b/webapp/load_tests/GuestTest2.scala @@ -0,0 +1,138 @@ + +import scala.concurrent.duration._ + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.jdbc.Predef._ + +class GuestTest2 extends Simulation { + + private val httpProtocol = http + .baseUrl("http://wiqen1b.serveminecraft.net:3000") + .inferHtmlResources() + .acceptHeader("image/avif,image/webp,*/*") + .acceptEncodingHeader("gzip, deflate") + .acceptLanguageHeader("en-US,en;q=0.5") + .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0") + + private val headers_0 = Map( + "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", + "If-None-Match" -> """"7fb8e46b93553a316e0f0797b662c57bad733dfe"""", + "Upgrade-Insecure-Requests" -> "1" + ) + + private val headers_1 = Map( + "Accept" -> "text/css,*/*;q=0.1", + "If-None-Match" -> """"1c5e40f1aec9aa27ef4094814fa3bcfd75d36c7e"""" + ) + + private val headers_2 = Map( + "Accept" -> "*/*", + "If-None-Match" -> """"5e5bb1e21cd7e4c4090b7468046fbbe5a4a36578"""" + ) + + private val headers_3 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") + + private val headers_4 = Map("If-None-Match" -> """"65ee095e47921eb3939c327551323d2160b957d0"""") + + private val headers_5 = Map("If-None-Match" -> """"86e23e6bf049be077067249dc086499dfde7620a"""") + + private val headers_6 = Map("If-None-Match" -> """"65ec1acbd922addd29cfa24a8bb6eba228e9762b"""") + + private val headers_7 = Map("If-None-Match" -> """"d1ac1507d79525e81a1f0c8dbf66acc65af43b05"""") + + private val headers_8 = Map( + "Accept" -> "*/*", + "Access-Control-Request-Headers" -> "token", + "Access-Control-Request-Method" -> "GET", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_9 = Map( + "Accept" -> "application/json, text/plain, */*", + "If-None-Match" -> """W/"211-eylKOmNwJm7M9mm/No1Pt93T4EA"""", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000", + "token" -> "" + ) + + private val headers_10 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "If-None-Match" -> """"c2dc612cee2618539cc80edc7e71982b39d16900"""", + "Range" -> "bytes=0-" + ) + + private val headers_11 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "If-None-Match" -> """"ede98d89d2ac6ceec41bf22df94c4f8deaa5490e"""", + "Range" -> "bytes=0-" + ) + + private val headers_12 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "Range" -> "bytes=0-" + ) + + private val uri2 = "http://20.123.45.199:8000/questions/en" + + private val scn = scenario("GuestTest") + .exec( + http("request_0") + .get("/") + .headers(headers_0) + .resources( + http("request_1") + .get("/static/css/main.ea46ba81.css") + .headers(headers_1), + http("request_2") + .get("/static/js/main.72c32461.js") + .headers(headers_2), + http("request_3") + .get("/help.png") + .headers(headers_3), + http("request_4") + .get("/logo.jpg") + .headers(headers_4), + http("request_5") + .get("/game.png") + .headers(headers_5), + http("request_6") + .get("/login.png") + .headers(headers_6), + http("request_7") + .get("/signup.png") + .headers(headers_7) + ), + pause(1), + http("request_8") + .options(uri2) + .headers(headers_8) + .resources( + http("request_9") + .get(uri2) + .headers(headers_9) + ), + pause(1), + http("request_10") + .get("/incorrect.mp3") + .headers(headers_10) + .resources( + http("request_11") + .get("/correct.mp3") + .headers(headers_11) + ), + pause(3), + http("request_12") + .get("/incorrect.mp3") + .headers(headers_12) + .resources( + http("request_13") + .get("/correct.mp3") + .headers(headers_12) + ) + ) + + setUp(scn.inject(constantUsersPerSec(20).during(60)).protocols(httpProtocol)) +} From 5bf6123f0c75f72a80dc663bc5a460d87f4fb160 Mon Sep 17 00:00:00 2001 From: ErdemYabaci Date: Sat, 27 Apr 2024 21:31:39 +0200 Subject: [PATCH 09/11] guest test for burst purposes --- webapp/load_tests/BURSTGuestTest.scala | 138 +++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 webapp/load_tests/BURSTGuestTest.scala diff --git a/webapp/load_tests/BURSTGuestTest.scala b/webapp/load_tests/BURSTGuestTest.scala new file mode 100644 index 00000000..1d07a4d9 --- /dev/null +++ b/webapp/load_tests/BURSTGuestTest.scala @@ -0,0 +1,138 @@ + +import scala.concurrent.duration._ + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.jdbc.Predef._ + +class GuestTest extends Simulation { + + private val httpProtocol = http + .baseUrl("http://wiqen1b.serveminecraft.net:3000") + .inferHtmlResources() + .acceptHeader("image/avif,image/webp,*/*") + .acceptEncodingHeader("gzip, deflate") + .acceptLanguageHeader("en-US,en;q=0.5") + .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0") + + private val headers_0 = Map( + "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", + "If-None-Match" -> """"7fb8e46b93553a316e0f0797b662c57bad733dfe"""", + "Upgrade-Insecure-Requests" -> "1" + ) + + private val headers_1 = Map( + "Accept" -> "text/css,*/*;q=0.1", + "If-None-Match" -> """"1c5e40f1aec9aa27ef4094814fa3bcfd75d36c7e"""" + ) + + private val headers_2 = Map( + "Accept" -> "*/*", + "If-None-Match" -> """"5e5bb1e21cd7e4c4090b7468046fbbe5a4a36578"""" + ) + + private val headers_3 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") + + private val headers_4 = Map("If-None-Match" -> """"65ee095e47921eb3939c327551323d2160b957d0"""") + + private val headers_5 = Map("If-None-Match" -> """"86e23e6bf049be077067249dc086499dfde7620a"""") + + private val headers_6 = Map("If-None-Match" -> """"65ec1acbd922addd29cfa24a8bb6eba228e9762b"""") + + private val headers_7 = Map("If-None-Match" -> """"d1ac1507d79525e81a1f0c8dbf66acc65af43b05"""") + + private val headers_8 = Map( + "Accept" -> "*/*", + "Access-Control-Request-Headers" -> "token", + "Access-Control-Request-Method" -> "GET", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_9 = Map( + "Accept" -> "application/json, text/plain, */*", + "If-None-Match" -> """W/"211-eylKOmNwJm7M9mm/No1Pt93T4EA"""", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000", + "token" -> "" + ) + + private val headers_10 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "If-None-Match" -> """"c2dc612cee2618539cc80edc7e71982b39d16900"""", + "Range" -> "bytes=0-" + ) + + private val headers_11 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "If-None-Match" -> """"ede98d89d2ac6ceec41bf22df94c4f8deaa5490e"""", + "Range" -> "bytes=0-" + ) + + private val headers_12 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "Range" -> "bytes=0-" + ) + + private val uri2 = "http://20.123.45.199:8000/questions/en" + + private val scn = scenario("GuestTest") + .exec( + http("request_0") + .get("/") + .headers(headers_0) + .resources( + http("request_1") + .get("/static/css/main.ea46ba81.css") + .headers(headers_1), + http("request_2") + .get("/static/js/main.72c32461.js") + .headers(headers_2), + http("request_3") + .get("/help.png") + .headers(headers_3), + http("request_4") + .get("/logo.jpg") + .headers(headers_4), + http("request_5") + .get("/game.png") + .headers(headers_5), + http("request_6") + .get("/login.png") + .headers(headers_6), + http("request_7") + .get("/signup.png") + .headers(headers_7) + ), + pause(1), + http("request_8") + .options(uri2) + .headers(headers_8) + .resources( + http("request_9") + .get(uri2) + .headers(headers_9) + ), + pause(1), + http("request_10") + .get("/incorrect.mp3") + .headers(headers_10) + .resources( + http("request_11") + .get("/correct.mp3") + .headers(headers_11) + ), + pause(3), + http("request_12") + .get("/incorrect.mp3") + .headers(headers_12) + .resources( + http("request_13") + .get("/correct.mp3") + .headers(headers_12) + ) + ) + + setUp(scn.inject(constantUsersPerSec(200).during(12)).protocols(httpProtocol)) +} From a4057e734d369f1f5350628ba20abbf3d0a2376a Mon Sep 17 00:00:00 2001 From: ErdemYabaci Date: Sat, 27 Apr 2024 21:36:46 +0200 Subject: [PATCH 10/11] forgot to change the class name* --- webapp/load_tests/BURSTGuestTest.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/load_tests/BURSTGuestTest.scala b/webapp/load_tests/BURSTGuestTest.scala index 1d07a4d9..21004864 100644 --- a/webapp/load_tests/BURSTGuestTest.scala +++ b/webapp/load_tests/BURSTGuestTest.scala @@ -5,7 +5,7 @@ import io.gatling.core.Predef._ import io.gatling.http.Predef._ import io.gatling.jdbc.Predef._ -class GuestTest extends Simulation { +class BurstGuestTest extends Simulation { private val httpProtocol = http .baseUrl("http://wiqen1b.serveminecraft.net:3000") From f318d8d6019444624d1832bbad339c375e7b5a29 Mon Sep 17 00:00:00 2001 From: ErdemYabaci Date: Sat, 27 Apr 2024 21:46:37 +0200 Subject: [PATCH 11/11] login and play test for burst purposes --- webapp/load_tests/BURSTLoginTest.scala | 245 +++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 webapp/load_tests/BURSTLoginTest.scala diff --git a/webapp/load_tests/BURSTLoginTest.scala b/webapp/load_tests/BURSTLoginTest.scala new file mode 100644 index 00000000..a0c8a6db --- /dev/null +++ b/webapp/load_tests/BURSTLoginTest.scala @@ -0,0 +1,245 @@ + +import scala.concurrent.duration._ + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.jdbc.Predef._ + +class BurstLoginTest extends Simulation { + + private val httpProtocol = http + .baseUrl("http://wiqen1b.serveminecraft.net:3000") + .inferHtmlResources() + .acceptHeader("image/avif,image/webp,*/*") + .acceptEncodingHeader("gzip, deflate") + .acceptLanguageHeader("en-US,en;q=0.5") + .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0") + + private val headers_0 = Map( + "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", + "If-None-Match" -> """"23cd247262374aa9f354f287be15b227be4ffdc8"""", + "Upgrade-Insecure-Requests" -> "1" + ) + + private val headers_1 = Map( + "Accept" -> "*/*", + "If-None-Match" -> """"0d9319e48bb9c6299e791d37bf623f9351ccefa1"""" + ) + + private val headers_2 = Map( + "Accept" -> "text/css,*/*;q=0.1", + "If-None-Match" -> """"1c5e40f1aec9aa27ef4094814fa3bcfd75d36c7e"""" + ) + + private val headers_3 = Map("If-None-Match" -> """"65ee095e47921eb3939c327551323d2160b957d0"""") + + private val headers_4 = Map("If-None-Match" -> """"7062713d84840244882292d3ba8b93bb59077815"""") + + private val headers_5 = Map("If-None-Match" -> """"d1ac1507d79525e81a1f0c8dbf66acc65af43b05"""") + + private val headers_6 = Map("If-None-Match" -> """"65ec1acbd922addd29cfa24a8bb6eba228e9762b"""") + + private val headers_7 = Map("If-None-Match" -> """"c50d19d0c435eda46d13e78270d4836236358229"""") + + private val headers_8 = Map( + "Accept" -> "*/*", + "Access-Control-Request-Headers" -> "content-type", + "Access-Control-Request-Method" -> "POST", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_9 = Map( + "Accept" -> "application/json, text/plain, */*", + "Content-Type" -> "application/json", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_15 = Map( + "Accept" -> "*/*", + "Access-Control-Request-Headers" -> "token", + "Access-Control-Request-Method" -> "GET", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_16 = Map( + "Accept" -> "application/json, text/plain, */*", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000", + "token" -> "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NjJkMjA0MTRkMDY2NjE0OGZkMDA3ZDIiLCJpYXQiOjE3MTQyMzM0MzksImV4cCI6MTcxNDIzNzAzOX0.MPgFSRGxoXlTmi8Tfe8ZWYSXQkCrqnVI3c80w7BEbbs" + ) + + private val headers_17 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "Range" -> "bytes=0-" + ) + + private val headers_21 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "If-None-Match" -> """"c2dc612cee2618539cc80edc7e71982b39d16900"""", + "Range" -> "bytes=0-" + ) + + private val headers_22 = Map( + "Accept" -> "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5", + "Accept-Encoding" -> "identity", + "If-None-Match" -> """"ede98d89d2ac6ceec41bf22df94c4f8deaa5490e"""", + "Range" -> "bytes=0-" + ) + + private val headers_24 = Map( + "Accept" -> "*/*", + "Access-Control-Request-Headers" -> "content-type,token", + "Access-Control-Request-Method" -> "POST", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000" + ) + + private val headers_25 = Map( + "Accept" -> "application/json, text/plain, */*", + "Content-Type" -> "application/json", + "Origin" -> "http://wiqen1b.serveminecraft.net:3000", + "token" -> "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NjJkMjA0MTRkMDY2NjE0OGZkMDA3ZDIiLCJpYXQiOjE3MTQyMzM0MzksImV4cCI6MTcxNDIzNzAzOX0.MPgFSRGxoXlTmi8Tfe8ZWYSXQkCrqnVI3c80w7BEbbs" + ) + + private val uri2 = "http://20.123.45.199:8000" + + private val scn = scenario("LoginTest") + .exec( + http("request_0") + .get("/") + .headers(headers_0) + .resources( + http("request_1") + .get("/static/js/main.e5ae103b.js") + .headers(headers_1), + http("request_2") + .get("/static/css/main.ea46ba81.css") + .headers(headers_2), + http("request_3") + .get("/logo.jpg") + .headers(headers_3), + http("request_4") + .get("/help.png") + .headers(headers_4), + http("request_5") + .get("/signup.png") + .headers(headers_5), + http("request_6") + .get("/login.png") + .headers(headers_6), + http("request_7") + .get("/instrucciones.png") + .headers(headers_7) + ), + pause(7), + http("request_8") + .options(uri2 + "/login") + .headers(headers_8) + .resources( + http("request_9") + .post(uri2 + "/login") + .headers(headers_9) + .body(RawFileBody("logintest/0009_request.json")), + http("request_10") + .get("/menu") + .headers(headers_0), + http("request_11") + .get("/static/js/main.e5ae103b.js") + .headers(headers_1), + http("request_12") + .get("/static/css/main.ea46ba81.css") + .headers(headers_2), + http("request_13") + .get("/logo.jpg") + .headers(headers_3), + http("request_14") + .get("/help.png") + .headers(headers_4) + ), + pause(6), + http("request_15") + .options(uri2 + "/questions/en") + .headers(headers_15) + .resources( + http("request_16") + .get(uri2 + "/questions/en") + .headers(headers_16), + http("request_17") + .get("/tictac.mp3") + .headers(headers_17), + http("request_18") + .get("/tictac.mp3") + .headers(headers_17) + ), + pause(1), + http("request_19") + .get("/incorrect.mp3") + .headers(headers_17) + .resources( + http("request_20") + .get("/correct.mp3") + .headers(headers_17) + ), + pause(2), + http("request_21") + .get("/incorrect.mp3") + .headers(headers_21), + pause(3), + http("request_22") + .get("/correct.mp3") + .headers(headers_22) + .resources( + http("request_23") + .get("/incorrect.mp3") + .headers(headers_21) + ), + pause(2), + http("request_24") + .options(uri2 + "/record") + .headers(headers_24) + .resources( + http("request_25") + .post(uri2 + "/record") + .headers(headers_25) + .body(RawFileBody("logintest/0025_request.json")) + ), + pause(5), + http("request_26") + .options(uri2 + "/record/loadtest") + .headers(headers_15) + .resources( + http("request_27") + .get(uri2 + "/record/loadtest") + .headers(headers_16) + ), + pause(7), + http("request_28") + .get("/home") + .headers(headers_0) + .resources( + http("request_29") + .get("/static/js/main.e5ae103b.js") + .headers(headers_1), + http("request_30") + .get("/static/css/main.ea46ba81.css") + .headers(headers_2), + http("request_31") + .get("/help.png") + .headers(headers_4), + http("request_32") + .get("/logo.jpg") + .headers(headers_3), + http("request_33") + .get("/signup.png") + .headers(headers_5), + http("request_34") + .get("/login.png") + .headers(headers_6), + http("request_35") + .get("/instrucciones.png") + .headers(headers_7) + ) + ) + + setUp(scn.inject(constantUsersPerSec(100).during(12)).protocols(httpProtocol)) +}