如何将值bean shell采样器发送到jmeter中的rest api [英] How to send values bean shell sampler to a rest api in jmeter

查看:110
本文介绍了如何将值bean shell采样器发送到jmeter中的rest api的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我是Jmeter的新手.我有一种情况,我在一个.csv文件中设置了20000个用户的employeeeeid,并且我有一个rest api路径/getempid/$ {empid}.方案是一次有1000位用户按一次api,并且每持有20到25秒一次.在20 25秒后,另一组用户说有3000个用户点击了该api.我有一个CSV数据集配置,Bean Shell采样器和Ultimate线程组.

To begin with i am new to Jmeter. I have a scenario where i have set of 20000 usersemployeeid in a .csv file and i have a rest api path/getempid/${empid}. Scenario is 1000 users hit the api at a time and for every 20-25 seconds they hold. and after 20 25 seconds another set of users say 3000 users hit the api. I have a CSV data set config, bean shell sampler and Ultimate thread group.

请找到以下附件

当我运行测试时,视图结果树中的结果看起来像

When i run the test the result in view results tree looks like

BeanshellSampler 111 111 111 222 111 222 111 333 333 333 222 111

BeanshellSampler 111 111 111 222 111 222 111 333 333 333 222 111

相反

111 222 333 444 555

111 222 333 444 555

等等

也不要一次运行.输入500.

Also instead of running for one time. There is an entry of 500.

我的情况是.csv文件中有20个用户,第一个10个用户应点击api,然后第二个设置10个用户

My scenario is 20 users in .csv file 1st 10 users should hit the api and then the second set of 10 users

推荐答案

我认为这是由于您的最终线程组设置所致.将起始线程组数设置为10,其余所有值都置为0,以获得111222333.

I think this is because of your ultimate thread group settings. Put start thread group count as 10 and rest everything 0 to get 111 222 333.

查看输出,除开始线程计数"外,所有内容均为0:-

See the output with everything 0 except for "start thread count":-

如果您希望输出多次,则结果将与现在得到的结果相同.

If you want output to be multiple times then the result will be same as you are getting now.

我希望有帮助.

这篇关于如何将值bean shell采样器发送到jmeter中的rest api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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