Thrift API负载测试 [英] Thrift API load test
问题描述
我是Apache Jmeter的新手.基本上,我想对我们的两个过时的API进行负载测试,但是不知道从哪里开始.在Java中,api接受2个参数,然后发送java对象作为响应.
I am new into Apache Jmeter. Basically I want to load test our couple of thrift APIs but have no clue where to start with. It is in java where api takes 2 parameter and then send java object as response.
任何指针都将非常有帮助.
Any pointer would be very helpful.
推荐答案
您可以使用JSR223 Sampler + Groovy(在jmeter/lib中添加groovy-all.jar)并查看此客户端示例,有关示例,请参见NonblockingClient代码:
You can use JSR223 Sampler + Groovy (add groovy-all.jar in jmeter/lib) and look at this client example, see NonblockingClient code for an example:
使常规代码至少应至少调用以下内容:
Make your groovy code call a least the following at end:
SampleResult.setSuccessful(true/false)
SampleResult.setResponseCode("code")
SampleResult.setResponseMessage("message")
请参阅:
当然,请确保在jmeter/lib中添加所需的依赖项.
And of course, ensure you add the required dependencies in jmeter/lib.
这篇关于Thrift API负载测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!