how can I log the current threadcount in SOAPUI?

房东的猫 提交于 2019-12-25 08:35:01

问题


I need to create a log file from a SOAPUI load test that shows the threadcount at 1-second intervals. The file needs only a timestamp and the threadcount, and can be CSV or any other format really. I can't see a way to get just this info from the predefined log files.

Is a Groovy script step the right way to do this? How would I write it? I could have a test case that does nothing but writes the log message every second while the "real" cases are running concurrently, but I don't know how to write that simple bit of script. I find the documentation almost impenetrable.

Thanks in advance!


回答1:


This runs faster than once per second. If it works for you I can explain how to cut the time down:

if (context.LoadTestContext != null)
{
    log.info("threads = " + testRunner.getRunContext().LoadTestRunner.getRunningThreadCount() )
}

(It is a Groovy script)

By the way, load test script logging is off by default in SoapUI. You need to go to Preferences, UI Settings & check the "Do not disable the groovy log when running load tests" checkbox.



来源:https://stackoverflow.com/questions/10543071/how-can-i-log-the-current-threadcount-in-soapui

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!