首页 > 解决方案 > 记录场景中的双重http请求

问题描述

我使用 Angular 和 Springboot 在微服务应用程序中记录了一个场景,但我观察到一些像这样的 http 请求的重复。

这两个请求完全一样?!我可以删除一个吗?

标签: javaspring-bootjmeter

解决方案


There is one "golden rule": well-behaved JMeter test must represent a real user using a real browser with 100% accuracy.

So you should not be asking random people over the internet whether you need to remove a request, you need to check whether your browser sends 1 or 2 requests, you can do this using your browser developer tools or an external sniffer tool like Fiddler or Wireshark

JMeter shouldn't generate duplicate requests, if you seeing 2 similar (or same) ones it means that your browser actually sent them so you should have the same network footprint in JMeter. If you don't want duplicate code - delete one and put another under the Loop Controller.

Your application might use some polling mechanism periodically sending AJAX requests for updating a part of data on the page and you should be doing the same in JMeter


推荐阅读