简体   繁体   English

使用JMeter测试套接字

[英]Using JMeter to test a socket

I would like to use JMeter to test an application that communicates over sockets. 我想使用JMeter来测试通过套接字进行通信的应用程序。 It is done in java. 它是在java中完成的。 In the server I have the typical 在服务器我有典型的

myServerSocket = new ServerSocket(1025);

For every connection a thread reads and understands a line. 对于每个连接,线程读取并理解一条线。 And in clients I have the typical 在客户中,我有典型的

clientSocket = new Socket(hostCM, 1025);
out = new PrintWriter(clientSocket.getOutputStream(), true);
out.println("some bit string here");

I would like to use JMeter or any other load testing tool to send lots of requests at the same time and make my stress and load testing. 我想使用JMeter或任何其他负载测试工具同时发送大量请求并进行压力和负载测试。 But I dont know how to prepare a test. 但我不知道如何准备测试。 Is is possible to do this in JMeter at all? 可以在JMeter中完成吗?

尝试使用JMeter的Java Request Sampler: http//jmeter.apache.org/usermanual/component_reference.html#Java_Request

So this is good info I was able to get my jmx working by setting the re-use connection and Set No delay in the TCP Sampler. 所以这是一个很好的信息我能够通过在TCP采样器中设置重用连接和设置无延迟来使我的jmx工作。 More info here . 更多信息在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM