Created
January 21, 2023 19:00
-
-
Save slawekradzyminski/804b0eda7a031e1e0e15eaeee4cb170c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.gatling.core.Predef; | |
import io.gatling.core.scenario.Simulation; | |
import io.gatling.core.structure.ScenarioBuilder; | |
import io.gatling.http.Predef; | |
import io.gatling.http.protocol.HttpProtocolBuilder; | |
public class SimpleLoadTest extends Simulation { | |
HttpProtocolBuilder httpConf = Predef.http().baseUrl("http://localhost:8080") | |
.acceptHeader("application/json"); | |
ScenarioBuilder scn = Predef.scenario("Simple Load Test") | |
.exec(Predef.http("request_1") | |
.get("/api/endpoint") | |
.check(Predef.status().is(200)) | |
.check(Predef.jsonPath("$.key").is("value")) | |
); | |
{ | |
Predef.setUp( | |
scn.inject(Predef.constantUsersPerSec(10).during(10)) | |
.protocols(httpConf) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment