我在下面编写了以下加特林情景。我收到以下错误
值baseURL不是io.gatling.http.protocol.HttpProtocolBuilder的成员
我尝试直接导入io.gatling.http.protocol.HttpProtocolBuilder,但这并不能解决问题。谁能在下面的代码中找到根本原因?
此外,我希望这种情况在4个小时内可以增加2000个用户的100万个请求。下面的注射能否成功执行该负荷?
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class Kafka extends Simulation{
val httpProtocol = http.baseURL("https://apex-my-url-is.in.these.quotes.com");
val kafkaScenario = scenario("KafkaPerfTest")
.exec(http("Kafka Request").post("/method/method")
.header("Content-Type", "application/json")
.body(StringBody("""
{
"logDatetime": "2019-03-18T20:26:38.940Z",
"url": "/test",
"apiName": "test",
"apiVersion": "test",
"method": "GET",
"status": 200,
"vin": "TESTTESTVIN0001",
"accessToken": "test",
"user": "test",
"queryParams": "",
"requestHeader": "test",
"requestBody": "test",
"responseHeader": "test",
"responseBody": "test",
"responseTime": 200,
"traceId": "test",
"serviceName": "test",
"type": "INBOUND"
}
"""))
.check(status.is(202)));
setUp(kafkaScenario.inject(
constantConcurrentUsers(2000) during(4 hours))
.protocols(httpProtocol)
.throttle(jumpToRps(500),holdFor(4 hours)));
}
答案 0 :(得分:2)
尝试使用“ http.baseUrl”而不是“ http.baseURL”