- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
从 Jmeter TCP Sampler 检查 TCP 连接时,出现以下错误:
Response code: 500
Response message: org.apache.jmeter.protocol.tcp.sampler.ReadException: Error reading from server, bytes read: 0
我们尝试更改 EOL、连接和响应超时、重新使用连接和关闭连接设置,但没有成功。
Jmeter TCP 采样器日志:
2018-04-24 12:09:09,740 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2018-04-24 12:09:09,741 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2018-04-24 12:09:09,745 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2018-04-24 12:09:09,755 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : DS Requests
2018-04-24 12:09:09,756 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group DS Requests.
2018-04-24 12:09:09,764 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2018-04-24 12:09:09,765 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=5 perThread=5000.0 delayedStart=false
2018-04-24 12:09:09,765 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2018-04-24 12:09:09,765 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2018-04-24 12:09:09,766 INFO o.a.j.t.JMeterThread: Thread started: DS Requests 1-1
2018-04-24 12:09:09,767 INFO o.a.j.p.t.s.TCPClientImpl: Using platform default charset:windows-1252
2018-04-24 12:09:09,767 INFO o.a.j.p.t.s.TCPSampler: Using eolByte=10
2018-04-24 12:09:09,787 ERROR o.a.j.p.t.s.TCPSampler:
org.apache.jmeter.protocol.tcp.sampler.ReadException: Error reading from server, bytes read: 0
at org.apache.jmeter.protocol.tcp.sampler.TCPClientImpl.read(TCPClientImpl.java:131) ~[ApacheJMeter_tcp.jar:3.3 r1808647]
at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.sample(TCPSampler.java:403) [ApacheJMeter_tcp.jar:3.3 r1808647]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498) [ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424) [ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255) [ApacheJMeter_core.jar:3.3 r1808647]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_144]
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source) ~[?:1.8.0_144]
at java.net.SocketInputStream.read(Unknown Source) ~[?:1.8.0_144]
at java.net.SocketInputStream.read(Unknown Source) ~[?:1.8.0_144]
at org.apache.jmeter.protocol.tcp.sampler.TCPClientImpl.read(TCPClientImpl.java:114) ~[ApacheJMeter_tcp.jar:3.3 r1808647]
... 5 more
2018-04-24 12:09:09,788 INFO o.a.j.t.JMeterThread: Thread is done: DS Requests 1-1
2018-04-24 12:09:09,788 INFO o.a.j.t.JMeterThread: Thread finished: DS Requests 1-1
2018-04-24 12:09:09,789 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2018-04-24 12:09:09,789 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
请建议如何解决此问题。
最佳答案
使用 TCP 采样器检查连接不是最好的主意,我建议使用 JSR223 Sampler和 Socket改为上课:
def sock = new Socket()
def host = "example.com" // change it to your host
def port = 80 // change it to your port
def timeout = 1000 // change it to your timeout (in milliseconds)
sock.setSoTimeout(1000)
sock.connect(new InetSocketAddress(host, port))
if (sock.isConnected()) {
log.info('Connection established')
SampleResult.setSuccessful(true)
}
else {
log.info('Server is not listening')
SampleResult.setSuccessful(false)
}
参见 Apache Groovy - Why and How You Should Use It文章了解有关使用 Groovy 脚本增强 JMeter 测试的更多信息。
在大多数情况下,使用 HTTP Raw Request 会容易得多插件比 TCP 采样器。
关于java - Jmeter:TCP Sampler 错误:500 ReadException:从服务器读取错误,读取的字节数:0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49999049/
我正在开发一个必须使用 SMS 服务的应用程序。当我尝试发送短信时,出现以下奇怪的异常。有时 SMS 发送绝对没问题,但有时我会收到此异常。我不知道问题出在哪里。以下是我的代码: String me
我编写了一个远程服务,客户端可以使用 Android 提供的常用 IPC 机制登录,并且绑定(bind)似乎有效。当我去调用一个方法时,问题就出现了,在这个方法中我必须将一个对象作为参数传递,因为我得
我们的应用程序从我们的崩溃报告软件中收到了很多不同的 SecurityException 报告。这是崩溃的堆栈跟踪: java.lang.SecurityException: Unable to fi
看起来像这样的异常令人困惑: FATAL EXCEPTION: main java.lang.NullPointerException at android.os.Parcel.readExc
从 Jmeter TCP Sampler 检查 TCP 连接时,出现以下错误: Response code: 500 Response message: org.apache.jmeter.proto
我是一名优秀的程序员,十分优秀!