Java JMeter 延迟与加载时间(采样时间)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18510846/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 08:40:34  来源:igfitidea点击:

JMeter latency vs load time(sample time)

javatestingamazon-web-servicesamazon-ec2jmeter

提问by Jee Seok Yoon

I was running a test on my HTTP server and the transfer speed went really slow when I switched the server from localhost(used a laptop) to a AWS EC2 t.micro server.

我正在我的 HTTP 服务器上运行测试,当我将服务器从 localhost(使用笔记本电脑)切换到 AWS EC2 t.micro 服务器时,传输速度非常慢。

I want to know the difference between latency and load time(or sample time) when testing with JMeter. Load time is in "View results tree", and sample time is in "View results in table".

我想知道使用 JMeter 进行测试时延迟和加载时间(或采样时间)之间的区别。加载时间在“查看结果树”中,采样时间在“查看表中的结果”中。

Here's my question.

这是我的问题。

  1. When sending a zip file that's about 3.5mb, it takes about 0.5 seconds when tested in localhost. However, when I was testing it on EC2 server, it takes about 6~8 seconds. I know that 3.5mb is quite big, but isn't 8 second too slow?

  2. During my tests, JMeter shows that the latency is about 0.5~1 second when the load time is 6~8 second. What is the difference between those two?

  1. 发送大约 3.5mb 的 zip 文件时,在 localhost 中测试时大约需要 0.5 秒。但是,当我在 EC2 服务器上测试它时,大约需要 6~8 秒。我知道 3.5mb 很大,但是 8 秒是不是太慢了?

  2. 在我的测试中,JMeter 显示加载时间为 6~8 秒时延迟约为 0.5~1 秒。这两者有什么区别?

采纳答案by Andrei Botalov

Latencyis a difference between time when request was sent and time when response has started to be received.

延迟是发送请求的时间与开始接收响应的时间之间的差值。

Response time(= Sample time = Load time = Elapsed time) is a difference between time when request was sent and time when response has been fully received.

响应时间(= 采样时间 = 加载时间 = 已用时间)是发送请求的时间与完全接收到响应的时间之间的差值。

So Response time always >= latency.

所以响应时间总是 >= 延迟。

The larger file is, the larger difference between response time and latency will be.

文件越大,响应时间和延迟之间的差异就越大。

回答by Masud Shrabon

Latency= 922 ms means that it takes 922 ms as the first response of the request from when the request has been made.

延迟= 922 毫秒意味着从发出请求开始,需要 922 毫秒作为请求的第一个响应。

Sample Time(or Response Time)= 1232 ms means that it takes 1232 ms to process the request from when it has been made.

采样时间(或响应时间)= 1232 ms 意味着从发出请求开始需要 1232 ms 来处理请求。

Therefore, Response Time = Latency + Processing Time

因此,响应时间 = 延迟 + 处理时间