Jmeter Latency, Sample Time and 302s

Jmeter Results Table

When looking at the difference between sample time and latency in Jmeter, I have always used the following definitions:

Sample Time : Time from invoking the request to the last byte of the response coming back

Latency: Time from invoking the request to the first part (packet) of the response returning.

To confirm the above defintion I used the network sniffer wireshark while executing a simple Jmeter script for a single request to a web page. Using the network sniffer I can identify when Jmeter makes the first request for the webpage which typically includes opening a TCP/IP connection. I can then see when the first packet of the response arrive at the workstation and the last packet of the response arrives at the workstation. This allows me to build a driagram below to confirm the definitions above plus/minus a few milliseconds.

jmeter network flow

However, what happens when you have a page that redirect to another page. I noticed this when I had a script that included a redirect and the latency for the page was very small. I got out wireshark again and discovered that although the sample time captured the complete page time the latency only included the time to receive the 302 response back that the workstation. See below:

Jmeter network flow with HTTP 302


8 thoughts on “Jmeter Latency, Sample Time and 302s

  1. It is helpful. But one Question regarding Jmeter – How can we Sum all the 302’s nested Request Latency in Jmeter. Not able to do that and wondering why Jmeter not Include this in Transaction controller. Any way we can do this.

  2. Good question.. You are right it is not picked up in a transaction controller. The sample time is correct but not the latency. I shall give it some thought.

    1. Latency is a measure of the time delay between two events. Typically it is used to measure the time delay across a network.

  3. Awesome. Thanks for sharing this. The most lucid explanation and differentiation between ‘sample time’ and ‘latency’ in Jmeter.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s