Blazemeter中的加特林测试创建ClassNotFoundException

问题描述

我使用了Taurus Gatling指南来创建一个简单的性能测试,并将yaml和scala文件上传到blazemeter。当我在blazemeter中开始测试时,没有测试结果,并且bzt.log包含一个ClassNotFoundException

yaml的验证程序说很好,我什么也找不到,所以我迷路了...

我的blazemleter.yaml

execution:
  - executor: gatling
    scenario: products

    iterations: 15
    concurrency: 3
    ramp-up: 2

scenarios:
  products:
    script: productSimulation.scala
    simulation: test.productSimulation

我的productSimulation.scala主要是从其文档中复制的:

package test

import io.gatling.core.Predef._
import io.gatling.http.Predef._

class productSimulation extends Simulation {
    // parse load profile from Taurus
    val t_iterations = Integer.getInteger("iterations",100).toInt
    val t_concurrency = Integer.getInteger("concurrency",10).toInt
    val t_rampUp = Integer.getInteger("ramp-up",1).toInt
    val t_holdFor = Integer.getInteger("hold-for",60).toInt
    val t_throughput = Integer.getInteger("throughput",100).toInt
    val httpConf = http.baseURL("https://mydomain/")

    val header = Map(
        "Content-Type" -> """application/x-www-form-urlencoded""")

    val sessionHeaders = Map("Authorization" -> "Bearer ${access_token}","Content-Type" -> "application/json")

    // 'forever' means each thread will execute scenario until
    // duration limit is reached
    val loopScenario = scenario("products").forever() {
        // auth
        exec(http("POST OAuth Req")
            .post("https://oauth-provider")
            .formParam("client_secret","...")
            .formParam("client_id","...")
            .formParam("grant_type","client_credentials")
            .headers(header)
            .check(status.is(200))
            .check(jsonPath("$.access_token").exists
                .saveAs("access_token")))
            // read products
            .exec(http("products")
                .get("/products")
                .queryParam("limit",200)
                .headers(sessionHeaders))
    }

    val execution = loopScenario
        .inject(rampUsers(concurrency) over rampUp) // during for gatling 3.x
        .protocols(httpConf)

    setUp(execution).maxDuration(rampUp + holdFor)
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)