#scala #performance-testing #gatling #scala-gatling
#scala #тестирование производительности #gatling #scala-gatling
Вопрос:
Я пытаюсь зарегистрировать дополнительную информацию об ответе в результате gatling через http.extraInfoExtractor. Ниже приведен мой код, мне не удается выполнить то же самое, также упоминается ошибка. Пожалуйста, помогите.
Код :
package cloudnative
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class cloudnativems extends Simulation {
val nbUsers = Integer.getInteger("users", 1)
val myRamp = java.lang.Long.getLong("ramp", 0L)
val varPipelineId = sys.env.get("CI_PIPELINE_ID")
println(varPipelineId)
val httpProtocol = http
.baseUrl("https://lXXXXXXXXXX")
.inferHtmlResources()
.contentTypeHeader("application/json")
val scn = scenario("cloudnativems")
.exec(http("account_movement_post")
.post("/XXXXXXX/gatling-poc/demo/movement/account")
.extraInfoExtractor(extraInfo => List(extraInfo.response.statusCode.get))
.body(StringBody("""{
"movementId": "m0001",
"accountId": "a0001",
"amount": 2000,
"movementDate": "2019-02-26T09:34:50.301Z",
"counterparty": "c0001"
}""")))
.exec(http("account_movement_get")
.get("/XXXXXXX/gatling-poc/demo/movement/account/m0001")
)
setUp(scn.inject(atOnceUsers(1)).protocols(httpProtocol))
}
Ошибка
C:Sopra ProjectToolsgatling-charts-highcharts-bundle-3.0.3bin>gatling.bat -s cloudnative.cloudnativems
GATLING_HOME is set to "C:Sopra ProjectToolsgatling-charts-highcharts-bundle-3.0.3"
JAVA = ""C:Program FilesJavajdk1.8.0_201binjava.exe""
11:56:14.849 [ERROR] i.g.c.ZincCompiler$ - C:Sopra ProjectToolsgatling-charts-highcharts-bundle-3.0.3user-filessimulationscloudnativecloudnativems.scala:25:8: value extraInfoExtractor is not a member of io.gatling.http.request.builder.HttpRequestBuilder
possible cause: maybe a semicolon is missing before `value extraInfoExtractor'?
.extraInfoExtractor(extraInfo => List(extraInfo.response.statusCode.get))
^
11:56:15.190 [ERROR] i.g.c.ZincCompiler$ - one error found
11:56:15.193 [ERROR] i.g.c.ZincCompiler$ - Compilation crashed
sbt.internal.inc.CompileFailed: null
Ответ №1:
extraInfoExtractor был удален с версией 3.0 в соответствии с https://gatling.io/docs/current/migration_guides/2.3-to-3.0 /:
extraInfoExtractor был удален, поскольку он не использовался ни в одном компоненте Gatling
Я не знаю о заменяющей конструкции в Gatling 3.0
Приветствую, Маттиас