Gatling中的数据馈送器实现RESTful Web服务负载测试

时间:2014-12-08 10:48:46

标签: load-testing gatling

我正在实施Gatling工具来加载测试我们的RESTful Web API方法,     由于某种原因,我没有成功将输入数据参数化为URI。

I am getting "i.g.h.a.AsyncHandlerActor" error.. 
it would be great if I'm able to see what exactly the end URI where the call was made.

below is my Scala code for one of the method to be load tested

import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
import java.util.concurrent.ThreadLocalRandom

class StockRun3 extends Simulation {

  val httpConf = http
    .baseURL("http://xxx.xxx.xx.xx:95/v9/stk")
    .acceptHeader("application/json")
    .authorizationHeader("appKeyToken=XXXXXXX&appKey=YYYYYYYYYY")

   object Search {  
        val Datafeeder= csv("StockDataSource2.csv").random

        val search = feed(Datafeeder)
            .exec(http("Search")
            .get("/availability")
            .queryParam("""productIds""","""${product}""")
            .queryParam("""ocationIds""","""${store}""")
             )
            .pause(1)
    }

  val users = scenario("Users").exec(Search.search)

  setUp(
    users.inject(nothingFor(4 seconds),
    atOnceUsers(10),
    rampUsers(10) over(60 seconds),
    constantUsersPerSec(2) during(30 seconds))

  ).protocols(httpConf)
  }

1 个答案:

答案 0 :(得分:0)

作为explained in the documentation,降低logback.xml中的日志记录级别。 然后,你在#oc; ocationIds" queryParam。