I am trying to learn about load-testing and K6 tool and I encountered a strange behavior. My script is the following:
import http from 'k6/http'
import { group } from 'k6'
export let options= {
vus: 1,
iterations: 1,
summaryTrendStats: ['avg', 'min', 'med', 'max', 'p(90)', 'p(96)', 'count'],
thresholds: {
'group_duration{group:::myFirstGroup}': []
},
}
export default function() {
group("myFirstGroup", function(){
http.get('http://localhost:4444/1')
})
}
So, as you can see, the script is very simple. It just has one group with one http request and it all gonna be done by one VU in one iteration. Also, the target endpoint (http://localhost:4444/1) is very simple, it just returns Hello world!.
What confuses me are the metrics I got in the summary. They are as follows:
The documentation says the following for http_req_blocked, http_req_connecting and http_req_duration metrics:
- http_req_blocked - denotes the time waiting on free TCP connection slot,
- http_req_connecting - denotes the time spent on establishing TCP connection, and
- http_req_duration - denotes the total time for the request and response after connection.
So, nothing happens in parallel and I expect the group time to be equals to http_req_blocked + http_req_connecting + http_req_duration or at least to be a little bit higher (in pico/nano) due to the not fully accurate timer. However, as you can see, I am getting much less time for the group, that is 10.89ms < 10.34ms + 0.9994ms + 0.8903ms.
Why and how does this happen?
