Scala Gatling Value baseURL不是io.Gatling.http.protocol.HttpProtocolBuilder的成员

Scala Gatling Value baseURL不是io.Gatling.http.protocol.HttpProtocolBuilder的成员,scala,simulation,gatling,Scala,Simulation,Gatling,我在下面写了下面的加特林情景。我得到以下错误 Value baseURL不是io.gatling.http.protocol.HttpProtocolBuilder的成员 我尝试直接导入io.gatling.http.protocol.HttpProtocolBuilder,但这并没有解决问题。有人能在我下面的代码中找出根本原因吗 另外,我希望这个场景能够在4小时内让2000个用户的请求增加到100万个。下面的注入是否成功执行该加载 import io.gatling.core.Predef.

我在下面写了下面的加特林情景。我得到以下错误

Value 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)));
  }

尝试“http.baseUrl”而不是“http.baseUrl”

这样做有效!我的设置是否正确,可以在4小时内向2000个用户发送100万个请求?使用此设置,您将在4小时内向2800万用户发送请求,但由于节流阀的作用,其中只有一部分用户能够执行请求,其余用户将卡在队列中,我不记得等待的用户是否正在打开连接,但您可能会用尽打开的套接字,或者以这种方式达到连接限制。我建议从减少用户数量和缩短测试时间开始,找出最适合您的价值。谢谢Mateusz。我们希望看到这项服务如何在请求数量极高的情况下运行。我们并不真正关心用户的数量。这就是我用“throtte”的原因。你会推荐ConstantuserPersec吗?它看起来像是在某个时候(可能是v3)在gatling库中被重命名为
baseURL
。因此,有效的情况将取决于您使用的是哪种版本的gatling。