简体   繁体   English

加特林scala扩展失败,找不到证据参数的隐式值

[英]Gatling scala extension fails with, could not find implicit value for evidence parameter

Trying to run a gatling 3.0.2 with a neat exetension method that I have been using many times before with gatling 2.2.x 尝试使用整洁的扩展方法运行gatling 3.0.2,我在gatling 2.2.x之前已经使用了很多次

implicit class Extensions(val scenario: ScenarioBuilder) extends AnyVal {
def injectDefaults: PopulationBuilder =
  scenario.inject(
    rampUsersPerSec(RAMP_USER_PER_SEC) to LOAD_FACTOR during (RAMP_UP_TIME seconds),
    constantUsersPerSec(LOAD_FACTOR) during (DURATION seconds)
  )

} }

But it no longer compiles, it fails with: 但它不再编译,失败并显示:

 could not find implicit value for evidence parameter of type 
 io.gatling.core.controller.inject.InjectionProfileFactory[Product with Serializable with io.gatling.core.controller.inject.open.OpenInjectionStep]
  scenario.inject(

Anyone knows why? 有人知道为什么吗?

Found the solution myself, was missing some implicit import. 我自己找到了解决方案,缺少一些隐式导入。 Here is the full code sample: 这是完整的代码示例:

import io.gatling.core.Predef.{constantUsersPerSec, rampUsersPerSec,_}
import io.gatling.core.structure.{PopulationBuilder, ScenarioBuilder}

import scala.concurrent.duration._

object Config {    
  val LOAD_FACTOR: Double = 50
  var RAMP_UP_TIME: Int = 10
  val RAMP_USER_PER_SEC = 0.1


  implicit class Extensions(val scenario: ScenarioBuilder) {
    def injectDefaults: PopulationBuilder =
      scenario.inject(
        rampUsersPerSec(RAMP_USER_PER_SEC) to LOAD_FACTOR during (RAMP_UP_TIME seconds),
        constantUsersPerSec(LOAD_FACTOR) during (DURATION seconds)
      )
  }

}

暂无
暂无

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

相关问题 Scala编译错误-找不到类型为证据的隐式值 - Scala compile error - could not find implicit value for evidence parameter of type 找不到类型^的证据参数的隐含值 - could not find implicit value for evidence parameter of type ^ 无法找到类型证据参数的隐式值 - Could not find implicit value for evidence parameter of type 找不到隐式json格式的证据参数的隐式值 - could not find implicit value for evidence parameter for implicit json formats 找不到scala.reflect.ClassManifest [T]类型的证据参数的隐式值 - Could not find implicit value for evidence parameter of type scala.reflect.ClassManifest[T] 斯卡拉<console> :24: 错误: 找不到微风.storage.DefaultArrayValue [Any] 类型的证据参数的隐式值 - Scala <console>:24: error: could not find implicit value for evidence parameter of type breeze.storage.DefaultArrayValue[Any] Scala / specs2:找不到 AsExecution[ExecutionEnv =&gt; MatchResult[Future[AuthenticationResult]]] 类型的证据参数的隐式值 - Scala / specs2 : could not find implicit value for evidence parameter of type AsExecution[ExecutionEnv => MatchResult[Future[AuthenticationResult]]] 找不到类型为证据的隐式值-Spark - could not find implicit value for evidence parameter of type - Spark 使用 scalamock:找不到类型错误的证据参数的隐式值 - Using scalamock: Could not find implicit value for evidence parameter of type error 无法找到有序类型的证据参数的隐含值[T] - could not find implicit value for evidence parameter of type Ordered[T]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM