英文:
Error while emitting RecordedSimulation in Gatling Tool
问题
在尝试运行gatling.sh
文件时出现以下错误。根据我的理解,在执行gatling.sh
时,RecorderSimulation.scala
文件中出现了编译问题。请查看以下错误并帮助我:
JAVA = "java"
11:51:37.496 [ERROR] i.g.c.ZincCompiler$ - 在发出 RecordedSimulation 时出现错误
方法过大:RecordedSimulation.<init>()V
11:51:37.520 [ERROR] i.g.c.ZincCompiler$ - 发现一个错误
11:51:37.531 [ERROR] i.g.c.ZincCompiler$ - 编译崩溃
sbt.internal.inc.CompileFailed: null
at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:122)
...
...
...
at io.gatling.compiler.ZincCompiler.main(ZincCompiler.scala)
选择一个模拟编号:
[0] computerdatabase.BasicSimulation
[1] computerdatabase.advanced.AdvancedSimulationStep01
[2] computerdatabase.advanced.AdvancedSimulationStep02
[3] computerdatabase.advanced.AdvancedSimulationStep03
[4] computerdatabase.advanced.AdvancedSimulationStep04
**请提供解决方案**
英文:
Getting below error when I am trying to run gatling.sh
file. From my understanding getting compilation issue in RecorderSimulation.scala file while doing gatling.sh
. Please see the below Error and help me
JAVA = "java"
11:51:37.496 [ERROR] i.g.c.ZincCompiler$ - Error while emitting
RecordedSimulation
Method too large: RecordedSimulation.<init> ()V
11:51:37.520 [ERROR] i.g.c.ZincCompiler$ - one error found
11:51:37.531 [ERROR] i.g.c.ZincCompiler$ - Compilation crashed
sbt.internal.inc.CompileFailed: null
at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:122)
at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:95)
at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:91)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:186)
at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3$adapted(MixedAnalyzingCompiler.scala:77)
at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:215)
at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:77)
at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:146)
at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:343)
at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:343)
at sbt.internal.inc.Incremental$.doCompile(Incremental.scala:120)
at sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:100)
at sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:180)
at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:98)
at sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:102)
at sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:155)
at sbt.internal.inc.Incremental$.compile(Incremental.scala:92)
at sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:75)
at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:348)
at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:301)
at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:168)
at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:248)
at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:74) at io.gatling.compiler.ZincCompiler$.doCompile(ZincCompiler.scala:211)
at io.gatling.compiler.ZincCompiler$.delayedEndpoint$io$gatling$compiler$ZincCompiler$1(ZincCompiler.scala:216)
at io.gatling.compiler.ZincCompiler$delayedInit$body.apply(ZincCompiler.scala:39)
at scala.Function0.apply$mcV$sp(Function0.scala:39)
at scala.Function0.apply$mcV$sp$(Function0.scala:39)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
at scala.App.$anonfun$main$1$adapted(App.scala:80)
at scala.collection.immutable.List.foreach(List.scala:392)
at scala.App.main(App.scala:80)
at scala.App.main$(App.scala:78)
at io.gatling.compiler.ZincCompiler$.main(ZincCompiler.scala:39)
at io.gatling.compiler.ZincCompiler.main(ZincCompiler.scala)
Choose a simulation number:
[0] computerdatabase.BasicSimulation
[1] computerdatabase.advanced.AdvancedSimulationStep01
[2] computerdatabase.advanced.AdvancedSimulationStep02
[3] computerdatabase.advanced.AdvancedSimulationStep03
[4] computerdatabase.advanced.AdvancedSimulationStep04
Please suggest solution
答案1
得分: 1
这个错误是由于 Scala 文件的大小过大导致的。您需要确保一个方法中的请求次数不超过100次。我也遇到了相同的问题,并通过将脚本拆分为两个方法来解决了这个问题。
英文:
This error is due to the size of the scala file being too large. You need to keep number of requests in a method to under 100. I faced the same issue and resolved it by splitting the script into two methods.
答案2
得分: 0
你已经成功生成了一些代码,但这些代码相对于Scala语言规范来说过大。
请确保您正在使用最新的Gatling版本(截至目前为止为3.3.1),如果没有,请进行升级。
如果问题仍然存在,请访问Gatling社区邮件列表并提供您的代码。
英文:
You've managed to generate some piece of code that's too large with regard to the Scala language spec.
Please make sure you're using latest Gatling version (3.3.1 as of now) and upgrade if not.
If problem still happens, please reach out on Gatling community mailing list and provide your code.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论