Transaction Response time

Hi Team,

New to K6, is there is a way to get individual transaction (group) response time like avg, median, min, max, and percentile.

  1. In the init section define your measurements.
const Login = new Trend('01Login');
  1. after the call assign a value to the measurement
const loginResponse = http.post(loginUrl.toString(), loginPayload,{loginParams,responseCallback: only422callback});
Login.add(loginResponse.timings.duration);
  1. at the end of the test the summary will report on the measurement, alongside the default metrics
     ✓ response body

     01Login........................: avg=403.911  min=403.911  med=403.911  max=403.911  p(90)=403.911  p(95)=403.911 
     checks.........................: 100.00% ✓ 2        ✗ 0
     data_received..................: 268 B   645 B/s
     data_sent......................: 148 B   356 B/s
     http_req_blocked...............: avg=379µs    min=379µs    med=379µs    max=379µs    p(90)=379µs    p(95)=379µs   
     http_req_connecting............: avg=203µs    min=203µs    med=203µs    max=203µs    p(90)=203µs    p(95)=203µs   
     http_req_duration..............: avg=403.91ms min=403.91ms med=403.91ms max=403.91ms p(90)=403.91ms p(95)=403.91ms
       { expected_response:true }...: avg=403.91ms min=403.91ms med=403.91ms max=403.91ms p(90)=403.91ms p(95)=403.91ms
     http_req_failed................: 0.00%   ✓ 0        ✗ 1
     http_req_receiving.............: avg=1.13ms   min=1.13ms   med=1.13ms   max=1.13ms   p(90)=1.13ms   p(95)=1.13ms  
     http_req_sending...............: avg=369µs    min=369µs    med=369µs    max=369µs    p(90)=369µs    p(95)=369µs   
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=402.4ms  min=402.4ms  med=402.4ms  max=402.4ms  p(90)=402.4ms  p(95)=402.4ms 
     http_reqs......................: 1       2.407359/s
     iteration_duration.............: avg=408.12ms min=408.12ms med=408.12ms max=408.12ms p(90)=408.12ms p(95)=408.12ms
     iterations.....................: 1       2.407359/s

Thanks, @BobRuub . How do we add the response time of multiple request timings to a single transaction?
Ex 01_Transaction=resp duration Req 01 + resp duration Req 02 + resp duration Req 03

Also how to handle the parallel request

Yes, adding the durations works if that’s what you require.

never used it myself but http batch seems to be what you are looking for…

1 Like