Can we limit the number of request hits per second in karate

放肆的年华 提交于 2020-04-16 03:22:13

问题


I am using karate 0.9.0. I need to limit the request hits to 5 per second in my test suite due to threshold limit at gateway. is it possible in karate or not? If yes, how?


回答1:


Here is the suggestion - configure headers as a JavaScript function. Within the function body - use a Java singleton (and a static method) to track how many requests have been sent and how much "sleep" needs to be added to maintain the required throttling / threshold.

You will need some Java skills to do this, all the best. The documentation has details on how to call Java code.



来源:https://stackoverflow.com/questions/56544696/can-we-limit-the-number-of-request-hits-per-second-in-karate

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!