JMeter配置:登录后的性能测试 [英] JMeter configuration: Performance testing after Login

查看:293
本文介绍了JMeter配置:登录后的性能测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的webapp中测试特定操作的性能。为了做到这一点,我必须先登录。基本上我有两个HTTP-Request,一个用于登录,另一个我想用多个同时线程(=用户)进行测试。

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.

我试过将进程分成多个ThreadGroup或setUp-ThreadGroup和ThreadGroup,问题是,登录请求将登录信息存储到HTTPSession中,我需要共享这些ThreadGroups中的会话。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆