"ambiguous statement error" 在并发线程组中使用带有变量名的 jexl3 表达式时
"ambiguous statement error" while using jexl3 expression with variable names in Concurrency Thread Group
注意:即使日志中有错误,脚本也会按预期执行。我试图了解如何删除这些泛滥日志的错误
我正在使用 JMeter 5.3 并使用吞吐量整形计时器设置并发线程组。
现在吞吐量整形计时器按预期工作,但是当我在配置中使用变量名称时,日志中充斥着 jexl3 错误。以下是我正在使用的配置的详细信息:
线程组:
当我在加速阶段使用变量名时,我在日志中一直收到以下错误
2021-05-17 19:13:49,454 ERROR o.a.j.f.Jexl3Function: An error occurred while evaluating the expression "${RampUpPeriod}/60"
org.apache.commons.jexl3.JexlException$Ambiguous: 60@1:17 ambiguous statement error in '${RampUpPeriod}/60'
at org.apache.commons.jexl3.parser.JexlParser.throwParsingException(JexlParser.java:270) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.parser.JexlParser.jjtreeCloseNodeScope(JexlParser.java:207) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.parser.Parser.ExpressionStatement(Parser.java:505) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.parser.Parser.Statement(Parser.java:350) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.parser.Parser.JexlScript(Parser.java:93) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.parser.Parser.parse(Parser.java:25) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.internal.Engine.parse(Engine.java:594) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.internal.Engine.createScript(Engine.java:261) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.internal.Engine.createScript(Engine.java:58) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.JexlEngine.createScript(JexlEngine.java:316) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.jmeter.functions.Jexl3Function.execute(Jexl3Function.java:96) ~[ApacheJMeter_functions.jar:5.3]
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:135) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:110) ~[ApacheJMeter_core.jar:5.3]
at kg.apc.jmeter.JMeterVariableEvaluator.evaluate(JMeterVariableEvaluator.java:9) ~[jmeter-plugins-cmn-jmeter-0.6.jar:?]
at com.blazemeter.jmeter.threads.LoadParamsFieldsPanel.UItoModel(LoadParamsFieldsPanel.java:45) ~[jmeter-plugins-casutg-2.9.jar:?]
at com.blazemeter.jmeter.threads.AbstractDynamicThreadGroupGui.updateUI(AbstractDynamicThreadGroupGui.java:139) ~[jmeter-plugins-casutg-2.9.jar:?]
at com.blazemeter.jmeter.threads.AbstractDynamicThreadGroupGui.run(AbstractDynamicThreadGroupGui.java:113) ~[jmeter-plugins-casutg-2.9.jar:?]
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316) ~[?:?]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) ~[?:?]
at java.awt.EventQueue.run(EventQueue.java:721) ~[?:?]
at java.awt.EventQueue.run(EventQueue.java:715) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) [?:?]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:740) [?:?]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?]
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?]
这听起来像是插件中的错误,您可以尝试通过 JMeter Plugins Support Forum. If you're a BlazeMeter customer you can open a BlazeMeter support ticket
联系 JMeter 插件开发人员和维护人员
同时,您可以通过在原始配置元素下方添加另一个 User Defined Variables 配置元素来解决此问题,并将您的计算逻辑放在那里:
完成后,您可以用计算变量替换并发线程组中的 __jexl3() 函数:
注意:即使日志中有错误,脚本也会按预期执行。我试图了解如何删除这些泛滥日志的错误
我正在使用 JMeter 5.3 并使用吞吐量整形计时器设置并发线程组。
现在吞吐量整形计时器按预期工作,但是当我在配置中使用变量名称时,日志中充斥着 jexl3 错误。以下是我正在使用的配置的详细信息:
线程组:
当我在加速阶段使用变量名时,我在日志中一直收到以下错误
2021-05-17 19:13:49,454 ERROR o.a.j.f.Jexl3Function: An error occurred while evaluating the expression "${RampUpPeriod}/60"
org.apache.commons.jexl3.JexlException$Ambiguous: 60@1:17 ambiguous statement error in '${RampUpPeriod}/60'
at org.apache.commons.jexl3.parser.JexlParser.throwParsingException(JexlParser.java:270) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.parser.JexlParser.jjtreeCloseNodeScope(JexlParser.java:207) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.parser.Parser.ExpressionStatement(Parser.java:505) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.parser.Parser.Statement(Parser.java:350) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.parser.Parser.JexlScript(Parser.java:93) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.parser.Parser.parse(Parser.java:25) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.internal.Engine.parse(Engine.java:594) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.internal.Engine.createScript(Engine.java:261) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.internal.Engine.createScript(Engine.java:58) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.commons.jexl3.JexlEngine.createScript(JexlEngine.java:316) ~[commons-jexl3-3.1.jar:3.1]
at org.apache.jmeter.functions.Jexl3Function.execute(Jexl3Function.java:96) ~[ApacheJMeter_functions.jar:5.3]
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:135) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:110) ~[ApacheJMeter_core.jar:5.3]
at kg.apc.jmeter.JMeterVariableEvaluator.evaluate(JMeterVariableEvaluator.java:9) ~[jmeter-plugins-cmn-jmeter-0.6.jar:?]
at com.blazemeter.jmeter.threads.LoadParamsFieldsPanel.UItoModel(LoadParamsFieldsPanel.java:45) ~[jmeter-plugins-casutg-2.9.jar:?]
at com.blazemeter.jmeter.threads.AbstractDynamicThreadGroupGui.updateUI(AbstractDynamicThreadGroupGui.java:139) ~[jmeter-plugins-casutg-2.9.jar:?]
at com.blazemeter.jmeter.threads.AbstractDynamicThreadGroupGui.run(AbstractDynamicThreadGroupGui.java:113) ~[jmeter-plugins-casutg-2.9.jar:?]
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316) ~[?:?]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) ~[?:?]
at java.awt.EventQueue.run(EventQueue.java:721) ~[?:?]
at java.awt.EventQueue.run(EventQueue.java:715) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) [?:?]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:740) [?:?]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?]
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?]
这听起来像是插件中的错误,您可以尝试通过 JMeter Plugins Support Forum. If you're a BlazeMeter customer you can open a BlazeMeter support ticket
联系 JMeter 插件开发人员和维护人员同时,您可以通过在原始配置元素下方添加另一个 User Defined Variables 配置元素来解决此问题,并将您的计算逻辑放在那里:
完成后,您可以用计算变量替换并发线程组中的 __jexl3() 函数: