JMeter异步API调用 [英] JMeter Asynchronous API calls
问题描述
我正在用Jmeter测试的移动应用程序在登录时进行了4个异步API调用.有什么方法可以用JMeter模拟吗?
The mobile app that I am testing with Jmeter makes 4 asynchronous API calls when logging in. Is there any way to simulate this with JMeter ?
当前,我只能让JMeter同步进行调用,因此,将它们全部包装在同一个事务控制器中时,响应时间是4个调用的总和(而不是最高的)
Currently I can only get JMeter to make the calls synchronously, so when wrapping them all in the same transaction controller, the response time is the total of the 4 calls (instead of the highest one)
非常感谢
推荐答案
当前JMeter不提供相关的测试元素,实现方案的最简单方法是使用
Currently JMeter doesn't offer a relevant test element, the easiest way of implementing your scenario is using JSR223 Sampler to perform nested asynchronous calls, something like:
请参见如何使用JMeter加载测试启用AJAX/XHR的站点指南,提供更详细的解释,代码段等.
See How to Load Test AJAX/XHR Enabled Sites With JMeter guide for more detailed explanation, code snippets,etc.
您还可以考虑开发具有类似功能的自定义采样器,并将其作为一部分JMeter作为插件,甚至与社区共享.
You can also consider developing a custom sampler with similar functionality and make it a part of your JMeter as a plugin or even share it with the community.
这篇关于JMeter异步API调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!