调试会话 [英] Debugging the session
问题描述
作为性能测试的一部分,我需要调试会话等.如果删除session =>
,则将运行相同的代码.当我补充说它说没有在仿真期间发送请求,因为它没有发送任何请求.
As part of my performance testing, I need to debug the session etc. The same code is running if I remove session =>
. When I add that it says there was no request sent during simulation since it is not sending any.
val scn1 = scenario("LaunchAction").exec{ session =>
http("Poll report status page report")
.get("myURL/rest/reports")
.queryParam("applicationId", "123")
.queryParam("id", "1")
.check(xpath("//status").saveAs("responseStatus"))
session
}
我需要在中间添加一些印刷品.您能提供一些信息吗?
I need to add few prints etc in between. Can you please provide some information?
推荐答案
我刚开始使用加特林(Gatling),却遇到了完全相同的问题. 对我来说,最简单的调试方法是添加入口点对象,该对象用于通过运行main方法在本地启动/调试测试
I just started with Gatling and I had exactly the same problem. The easiest way to debug for me was the addition of the entrypoint object, which I use to start/debug tests locally by running the main method
object DebugEntrypoint {
def main(args: Array[String]) {
// This sets the class for the Simulation we want to run.
val simClass = classOf[Smoke].getName
val props = new GatlingPropertiesBuilder
props.sourcesDirectory("./src/test/scala")
props.binariesDirectory("./target/scala-2.10/classes")
props.simulationClass(simClass)
Gatling.fromMap(props.build)
}
}
从此处开始执行测试后,我在模拟中输入的任何断点都会在运行时暂停执行.一旦达到断点,就可以评估表达式并使用所有其他调试工具.
As soon as the test is being executed from here, any breakpoints I put in the simulation will pause execution during the runtime. As soon as you hit a breakpoint, you can evaluate expressions and have all other debug instruments at your bidding.
这篇关于调试会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!