gatling

Launch spring-boot app before Gatling simulation

流过昼夜 提交于 2021-02-10 04:57:47
问题 I have a spring-boot project powered by maven I would like to run load tests on, using Gatling. At this moment, I can run my simulation typing the following command : mvn gatling:execute It works correctly but I have to launch my springboot app manually or it won't work. Here is my Simulation class : package main.aperture.gatling import aperture.config.SpringBootApertureTestingConfiguration import io.gatling.core.Predef._ import io.gatling.core.structure.ScenarioBuilder import io.gatling.http

Ensure CSV records in Gatling using feeder

流过昼夜 提交于 2021-02-07 20:24:59
问题 I have created a simple feeder in Gatling with CSV. The script is working well and not getting any errors. I know values are fetching from the CSV during the load test. But how can I ensure which value is getting for each user. I have to ensure that first user should login with UserName: user1 and Password: password1. As I am very very new to Gatling I could not find a solution for this. Hence please help me to get a solution , Thanks in advance...... My CSV contains- Username Password user1

Request timeout in Gatling

不打扰是莪最后的温柔 提交于 2021-02-07 06:45:06
问题 I am using maven to run my Gatling (Scala) performance test. It gives me request timeout issue when I increase user from 100 to 150. If I set the number of user to 300, then I get following error in simulation log. // Gatling scenario injection val scn = scenario("UATEnvironmentTest") .exec(http("AdminLoginRequest") .post("/authorization_microservice/oauth/token") .headers(headers_1).body(RawFileBody("Login.txt")) .check(jsonPath("$.access_token") .saveAs("auth_token"))) .pause(2) setUp(scn

Gatling Scala:Unable to send auth token to the method using session variable

萝らか妹 提交于 2021-02-05 11:22:32
问题 It seems session variable used in below code is not able to pass the Token Type --> Bearer and access_token using session variable,here is the full code ,is it possible with you to have a look ,here is code provided ..no worries all tokens are dummy tokens as i haven changed before pasting code here.Test expects the login method to be executed first and then the CreatePrivateEvent method as the latter takes tokens from Login method hence i have written From Logs It looks Token Type --> Bearer

Gatling rampUser and active user

◇◆丶佛笑我妖孽 提交于 2021-01-29 18:48:59
问题 I use rampUsers(20)over (120) in my gatling load test. But I got the following result I expected the active user should be constant during the test. 回答1: rampUsers injects the defined numbers of users linearly over a given time. So your use of rampUsers(20)over (120) will result in gatling starting one user every 6 seconds. The graph you're getting shows this, but what might be confusing is that since your scenario completes in less than 6 seconds there's never more than one user active at a

Why is Gatling failing on a valid jsonpath?

旧巷老猫 提交于 2021-01-29 15:28:30
问题 I have the following .check on my returned body: (I changed the values for security reasons but the structure is the same) .exec(http("Get ids") .post("GetIds") .body(ElFileBody("json/getIds.json")).asJson .check(jsonPath("$...Types..[?(@.Type == 'web')].id").findAll.saveAs("IDLlist")) But the transaction fails with "Gettting findAll.exists extraction crashed: end of input expected when trying to extract values from a returned body" Gatling prints the body of the failed transaction, when I

Gatling - Setting Authorization header as part of request

你离开我真会死。 提交于 2021-01-29 07:42:46
问题 I'm trying to set my Authorization header based on a value from a feeder. It looks like the authorization header is being stripped/overwritten, when other headers are being successfully set. exec(http("Initialise Transaction") .put("/transaction") .header("Authorization","bearer ${token}") .header("X-Hello","bearer ${token}") The request is being made, and the server sees the "X-Hello" header, but not the "Authorization" header set to the exact same value. Documentation suggests I can set the

Kafka error: SLF4J: Failed toString() invocation on an object of type [org.apache.kafka.common.Cluster]

偶尔善良 提交于 2021-01-27 21:14:16
问题 I am trying to use Gatling with Kafka, but every so often get this error: 01:32:53.933 [kafka-producer-network-thread | producer-1] DEBUG o.apache.kafka.clients.NetworkClient - Sending metadata request ClientRequest(expectResponse=true, payload=null, request=RequestSend(header={api_key=3,api_version=0,correlation_id=12,client_id=producer-1}, body={topics=[test]})) to node 1011 SLF4J: Failed toString() invocation on an object of type [org.apache.kafka.common.Cluster] java.lang

Gatling: Understanding rampUsersPerSec(minTPS) to maxTPS during seconds

孤者浪人 提交于 2020-11-29 04:35:27
问题 I am checking a scala code for gatling where they inject transactions for the period of 20 seconds. /*TPS = Transaction Per Second */ val minTps = Integer.parseInt(System.getProperty("minTps", "1")) val maxTps = Integer.parseInt(System.getProperty("maxTps", "5")) var rampUsersDurationInMinutes =Integer.parseInt(System.getProperty("rampUsersDurationInMinutes", "20")) setUp(scn.inject( rampUsersPerSec(minTps) to maxTps during (rampUsersDurationInMinutes seconds)).protocols(tcilProtocol)) The

Gatling脚本编写技巧篇(二)

偶尔善良 提交于 2020-11-27 02:30:44
脚本示例: import io.gatling.core.Predef._ import io.gatling.http.Predef._ import scala.concurrent.duration._ class BaiduSimulation extends Simulation { //读取配置文件 val conf = ConfigFactory.load() //实例化请求方法 val httpProtocol = http.baseUrl(conf.getString("baseUrl")) //包装请求接口 val rootEndPointUsers = scenario("信贷重构") .exec(http("信贷重构-授信申请") .post("/apply") .header("Content-Type", "application/json") .header("Accept-Encoding", "gzip") .body(RawFileBody("computerdatabase/recordedsimulation/0001_request.json")) .check(status.is(200) .saveAs("myresponse") ) .check(bodyString.saveAs("Get_bodys"))) .exec{