diff --git a/powerjob-remote/powerjob-remote-benchmark/src/test/java/IDEPathHelper.java b/powerjob-remote/powerjob-remote-benchmark/src/test/java/IDEPathHelper.java index a6befe0b..5315cad1 100644 --- a/powerjob-remote/powerjob-remote-benchmark/src/test/java/IDEPathHelper.java +++ b/powerjob-remote/powerjob-remote-benchmark/src/test/java/IDEPathHelper.java @@ -4,6 +4,9 @@ import java.nio.file.Paths; import static java.util.Objects.requireNonNull; +/** + * @author gatling-maven-plugin-demo-java + */ public class IDEPathHelper { static final Path mavenSourcesDirectory; diff --git a/powerjob-remote/powerjob-remote-benchmark/src/test/java/tech/powerjob/remote/benchmark/HttpSimulation.java b/powerjob-remote/powerjob-remote-benchmark/src/test/java/tech/powerjob/remote/benchmark/HttpSimulation.java index 3348493f..cdc1bf7f 100644 --- a/powerjob-remote/powerjob-remote-benchmark/src/test/java/tech/powerjob/remote/benchmark/HttpSimulation.java +++ b/powerjob-remote/powerjob-remote-benchmark/src/test/java/tech/powerjob/remote/benchmark/HttpSimulation.java @@ -6,9 +6,7 @@ import static io.gatling.javaapi.http.HttpDsl.*; import io.gatling.javaapi.core.*; import io.gatling.javaapi.http.*; /** - * HTTP 压测模拟 - * - * + * 以 HTTP 为入口压测 * * @author tjq * @since 2023/1/8 @@ -24,11 +22,17 @@ public class HttpSimulation extends Simulation { .acceptEncodingHeader("gzip, deflate") .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0"); - ScenarioBuilder scn = scenario("HttpSimulation") // 7 - .exec(http("request_http") // 请求名称,用于压测报表展示 - .get("/pressure/ask?protocol=HTTP&debug=true&responseSize=1024")) // 9 + ScenarioBuilder httpAsk = scenario("HttpSimulation") // 7 + .exec(http("PowerJob-Remote-Http") // 请求名称,用于压测报表展示 + .get("/pressure/ask?protocol=HTTP&debug=false&responseSize=1024")) // 9 .pause(5); // 10 + ScenarioBuilder akkaAsk = scenario("AkkaSimulation") // 7 + .exec(http("PowerJob-Remote-AKKA") // 请求名称,用于压测报表展示 + .get("/pressure/ask?protocol=AKKA&debug=false&responseSize=1024")) // 9 + .pause(5); // 10 + + /* atOnceUsers(10) 一次模拟的用户数量(10) nothingFor(4 seconds) 在指定的时间段(4 seconds)内什么都不干 @@ -39,7 +43,9 @@ public class HttpSimulation extends Simulation { { setUp( // 11 - scn.injectOpen(incrementUsersPerSec(10.0).times(2).eachLevelLasting(10)) // 12 + httpAsk.injectOpen(incrementUsersPerSec(10.0).times(2).eachLevelLasting(10)).andThen( + akkaAsk.injectOpen(incrementUsersPerSec(10.0).times(2).eachLevelLasting(10)) + ) // 12 ).protocols(httpProtocol); // 13 } }