Thrift API 负载测试 [英] Thrift API load test

查看:26
本文介绍了Thrift API 负载测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Apache Jmeter 的新手.基本上我想对我们的几个 thrift 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆