test: use gatling to test remote framework performance

This commit is contained in:
tjq 2023-01-15 22:58:44 +08:00
parent cd7a743097
commit c47fd69859

View File

@ -22,15 +22,22 @@ public class HttpSimulation extends Simulation {
.acceptEncodingHeader("gzip, deflate") .acceptEncodingHeader("gzip, deflate")
.userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0"); .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0");
ScenarioBuilder warmup = scenario("WarmupSimulation")
.exec(http("PowerJob-Warmup-HTTP")
.get("/pressure/ask?protocol=HTTP&debug=false&responseSize=1024"))
.exec(http("PowerJob-Warmup-AKKA")
.get("/pressure/ask?protocol=AKKA&debug=false&responseSize=1024"))
;
ScenarioBuilder httpAsk = scenario("HttpSimulation") // 7 ScenarioBuilder httpAsk = scenario("HttpSimulation") // 7
.exec(http("PowerJob-Remote-Http") // 请求名称用于压测报表展示 .exec(http("PowerJob-Remote-Http") // 请求名称用于压测报表展示
.get("/pressure/ask?protocol=HTTP&debug=false&responseSize=1024")) // 9 .get("/pressure/ask?protocol=HTTP&debug=false&responseSize=1024")) // 9
.pause(5); // 10 ;
ScenarioBuilder akkaAsk = scenario("AkkaSimulation") // 7 ScenarioBuilder akkaAsk = scenario("AkkaSimulation") // 7
.exec(http("PowerJob-Remote-AKKA") // 请求名称用于压测报表展示 .exec(http("PowerJob-Remote-AKKA") // 请求名称用于压测报表展示
.get("/pressure/ask?protocol=AKKA&debug=false&responseSize=1024")) // 9 .get("/pressure/ask?protocol=AKKA&debug=false&responseSize=1024")) // 9
.pause(5); // 10 ;
/* /*
@ -43,9 +50,13 @@ public class HttpSimulation extends Simulation {
{ {
setUp( // 11 setUp( // 11
httpAsk.injectOpen(incrementUsersPerSec(10.0).times(2).eachLevelLasting(10)).andThen( warmup.injectOpen(constantUsersPerSec(50).during(10))
akkaAsk.injectOpen(incrementUsersPerSec(10.0).times(2).eachLevelLasting(10)) .andThen(
) // 12 httpAsk.injectOpen(incrementUsersPerSec(100).times(10).eachLevelLasting(10))
)
.andThen(
akkaAsk.injectOpen(incrementUsersPerSec(100).times(10).eachLevelLasting(10))
)
).protocols(httpProtocol); // 13 ).protocols(httpProtocol); // 13
} }
} }