title: K6 Load Testing - I am completely baffled by the stats that are printed at the end
body: <p>Here is my very simple K6 script that I am running:</p>
  <pre><code>import {group } from &quot;k6&quot;;
  import { Trend} from &quot;k6/metrics&quot;;
  let response = null;
  let loginTime = new Trend('login_time');
  import http from &quot;k6/http&quot;;
  
  export let options = {
    stages: [
          {iterations: 1}
    ]
  };
  
  export default function(){
  
    group(&quot;Log In&quot;, function(){
      let url = &quot;myurl&quot;;
      let headers = {
            headers: {
              &quot;accept&quot;: &quot;*/*&quot;,
              &quot;accept-encoding&quot;: &quot;gzip, deflate, br&quot;,
              &quot;connection&quot;: &quot;keep-alive&quot;
            }
      };
      
      response = http.get(url,headers);
  
      loginTime.add(response.timings.duration);
      console.log(&quot;The duration for this request was:&quot; + response.timings.duration);
  })
  };
  </code></pre>
  <p>The script just sends one request and runs for one interation and I save the duration of this request to a Trend called 'login_time'.</p>
  <p>The stats that K6 prints at the end are as follows:</p>
  <pre><code>data_received..............: 29 kB  9.0 kB/s
      data_sent..................: 3.4 kB 1.1 kB/s
      group_duration.............: avg=3.15s      min=3.15s      med=3.15s      max=3.15s      p(90)=3.15s      p(95)=3.15s
      http_req_blocked...........: avg=414.88ms   min=2µs        med=291.79ms   max=1.31s      p(90)=976.28ms   p(95)=1.14s
      http_req_connecting........: avg=17.55ms    min=0s         med=25.97ms    max=31.96ms    p(90)=31.1ms     p(95)=31.53ms
      http_req_duration..........: avg=216.66ms   min=29.72ms    med=231.06ms   max=478.72ms   p(90)=407.62ms   p(95)=443.17ms
      http_req_receiving.........: avg=407.68µs   min=119.9µs    med=205.8µs    max=1.33ms     p(90)=892.84µs   p(95)=1.11ms
      http_req_sending...........: avg=74.86µs    min=12.4µs     med=76.8µs     max=170.2µs    p(90)=142.79µs   p(95)=156.49µs
      http_req_tls_handshaking...: avg=102.44ms   min=0s         med=73.61ms    max=315.35ms   p(90)=238.5ms    p(95)=276.93ms
      http_req_waiting...........: avg=216.18ms   min=29.59ms    med=230.68ms   max=477.3ms    p(90)=406.68ms   p(95)=441.99ms
      http_reqs..................: 5      1.563597/s
      iteration_duration.........: avg=3.15s      min=3.15s      med=3.15s      max=3.15s      p(90)=3.15s      p(95)=3.15s
      iterations.................: 1      0.312719/s
      login_time.................: avg=478.721924 min=478.721924 med=478.721924 max=478.721924 p(90)=478.721924 p(95)=478.721924
      vus........................: 1      min=1 max=1
      vus_max....................: 1      min=1 max=1
  </code></pre>
  <p>As you can see all the stats for my custom Trend 'login_time' show the same number 478.721924.</p>
  <p>'login_time' is recording the 'response.timings.duration' - duration here is supposed to be 'http_req_duration'.</p>
  <p>So I would expect the stats on the 'http_req_duration' row to be exactly the same as the 'login_time' stats i.e. all show 478.721924.</p>
  <p>Instead the stats on the 'http_req_duration' row are completely different and all show different numbers even though only 1 iteration was ran so they should all be the same. (Only the 'max' values shows 478.72).</p>
  <p>As only 1 iteration was ran - the data in each column for each row should be the same.</p>
  <p>So my question is, can I trust any of these numbers and if so which ones?</p>
  <p>Also, I want to report how long login took - is this just the http_req_duration value or do I have to include other values like http_req_blocked....or is that just waiting for K6 getting ready to send the request?</p>