jmter对WSS接口压测
需求:使用jmeter压测POST类型的WSS接口
思路:
- 使用java编译出发送wss接口请求
- 打包成jar包,放到jmeter lib ext下面
- jmeter 添加 后置处理器,BeanShell PostProcesser,添加jmeterClient的代码
jmeter调试代码如下
脚本1,JmeterClient.java
public class JmeterClient
{
public ststic void main(String[] args){
AstSend client = new AstSend();
String filepath = null;
filepath = "D/data/time.wav";
String response = client.send(filepath);
System.out.print(response);
}
}
AstSend.java
import org.java_websocket.client.WebSocketClient;
public class{
public String send(String filepath){
ArrayList<String> response = new ArrayList<String>();