JMeter 配置:登录后的性能测试 [英] JMeter configuration: Performance testing after Login
问题描述
我正在尝试在我的 web 应用程序中测试特定操作的性能.为此,我必须先登录.基本上我有两个 HTTP 请求,一个用于登录,另一个我想用多个并发线程(=用户)进行测试.
I'm trying to test the performance of a specific operation in my webapp. In order to do that, I have to first login. Basically I have two HTTP-Request, one for logging in and another one I want to test with multiple simultaneous Threads (=users).
为了在第二个请求上获得可比较的结果,我需要所有线程都完成第一个请求,这样第一个请求不会干扰第二个请求的性能.
In order to get comparable results on the second request, I need the first request to be finished by all Threads, so that the first request doesn'T interfere with the performance of the second request.
我尝试将进程拆分为多个线程组或在 setUp-ThreadGroup 和一个线程组中,问题是登录请求将登录信息存储到 HTTPSession 中,我需要在这些线程组中共享"会话.
I tried splitting up the process into multiple ThreadGroups or in a setUp-ThreadGroup and a ThreadGroup, the problem is, that the login request stores the login information into the HTTPSession and I would need to "share" the session accross those ThreadGroups.
我做了一些研究,但我找不到很多我能理解的东西.有没有简单的方法可以做到这一点?
I did some research but I can't find a lot i can make sense of. Is there an easy way to do this?
非常感谢任何帮助,谢谢!
Any help is greatly appreciated, thanks!
推荐答案
您可以使用 同步计时器作为子项添加到第二个请求采样器,其值要分组的同时用户数
= 线程总数.
You can do this in single Thread Group using Synchronizing Timer added to the 2nd request sampler as child, with value of Number of Simultaneous Users to Group by
= total number of threads.
这将暂停第二个请求的执行,直到所有线程完成第一个请求.
This will pause execution of 2nd request until 1st one will be completed with all the threads.
Thread Group
Number of Threads = N
+- Login Request
+- 1st Request
+- Synchronizing Timer
Number of Simultaneous Users to Group by = N
+- 2nd Request
+- Synchronizing Timer
Number of Simultaneous Users to Group by = N
这篇关于JMeter 配置:登录后的性能测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!