繁体   English   中英

如何通过改变随机值获得加特林模拟

[英]How to get gatling simulations with changing random values in it

Gatling 在模拟开始时读取场景,然后使用相同的配置/值执行几次。

例如,如何使用以下值“RANDOM-VALUE”执行每个请求,始终使用新的随机值?

val postRandomValue = scenario("Post Random Value")
    .exec(
      http("POST ShipmentList")
        .post("http://localhost:8080/endpoint") // Local
        .headers(Headers.header)
        .body(StringBody("myRandomValue: RANDOM-VALUE")))

喂食器将在这里提供帮助

val postRandomValue = scenario("Post Random Value")
.feed(Iterator.continually(Map(
  "RANDOM_VALUE" -> java.util.UUID.randomUUID.toString
)))
.exec(
  http("POST ShipmentList")
    .post("http://localhost:8080/endpoint") // Local
    .headers(Headers.header)
    .body(StringBody("myRandomValue: ${RANDOM_VALUE}")))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM