12

I've written the following Gatling scenario below. I'm getting the following error

Value baseURL is not a member of io.gatling.http.protocol.HttpProtocolBuilder

I tried directly importing the io.gatling.http.protocol.HttpProtocolBuilder but that did not solve the problem. Can anyone identify the root cause in my code below?

Also, I would like this scenario to ramp up to 1 million requests over 4 hours with 2000 users. Does the injection below successfully perform that load?

 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)));
  }
Zac Davidson
  • 247
  • 1
  • 6
  • 13

1 Answers1

15

Try "http.baseUrl" instead of "http.baseURL"

Bryan Herrera
  • 279
  • 2
  • 7
  • That worked! Is my setUp correct to ramp up to 1 million requests over 4 hours with 2000 users? – Zac Davidson Mar 19 '19 at 19:58
  • With this setup you will inject 28 millions users in 4 hours, but because of throttle only part of them will be able to execute requests, rest will stuck-up in queue, I do not remember if waiting users are opening connections but you may run out of open sockets or reach connections limit this way. I would recommend to start with lower number of users and shorter test and find out what is a best value for you. – Mateusz Gruszczynski Mar 19 '19 at 20:12
  • Thanks Mateusz. We are looking to see how this service performs with an extremely high number of requests. We aren't concerned really with the number of users. That's why I used 'throtte'. Would you recommend constantUsersPerSec? – Zac Davidson Mar 19 '19 at 20:22
  • It looks like `baseURL` was renamed `baseUrl` in the gatling libraries at some point (maybe v3). So the case that works will depend on which version of gatling you are using. – krock Jul 30 '20 at 23:19