我想创建 Jmeter 脚本,我可以在其中动态提供依赖 API 调用之间的延迟

I want to create Jmeter script in which I can provide delay between dependent API calls dynamically

我想创建 Jmeter 脚本,其中某些 api 调用仅在成功接收到它所依赖的 api 调用的响应后才进行。在 Jmeter 中有可能吗?如果是,请告诉我怎么做?

每个 JMeter 线程(虚拟用户)正在颠倒执行采样器(或根据 Logic Controllers) so given you have HTTP Request 采样器,例如:

  • HTTP 请求 1
  • HTTP 请求 2
  • HTTP 请求 3
  • 等等

每个 JMeter 线程都会顺序执行采样器,因此您基本上什么都不做。

除非您正尝试在不同的 Thread Groups, in that case you need to implement some synchronization between them so the threads which depend on previous results would wait until they are executed. You can implement it using Inter-Thread Communication 插件中同步线程 运行 以设置同步。

您可以使用 JMeter Plugins Manager

安装线程间通信插件