Hi all
I have a website here that has extremely long waiting times in some cases. Now I would like to know how many requests take longer than 2 seconds. As you can see below, my current script doesn’t work. The average duration is under 500ms. And some requests take up to 16 seconds.
✓ Status is 200
✗ Request duration is below 2s
↳ 0% — ✓ 0 / ✗ 51
checks.........................: 50.00% ✓ 51 ✗ 51
data_received..................: 2.1 MB 30 kB/s
data_sent......................: 12 kB 172 B/s
group_duration.................: avg=397.39ms min=45.02ms med=58.36ms max=16.15s p(90)=75.16ms p(95)=146.28ms
http_req_blocked...............: avg=1.93ms min=188ns med=532ns max=98.66ms p(90)=1.07µs p(95)=1.14µs
http_req_connecting............: avg=317.15µs min=0s med=0s max=16.17ms p(90)=0s p(95)=0s
http_req_duration..............: avg=395.13ms min=44.69ms med=58.02ms max=16.15s p(90)=74.88ms p(95)=145.96ms
{ expected_response:true }...: avg=395.13ms min=44.69ms med=58.02ms max=16.15s p(90)=74.88ms p(95)=145.96ms
http_req_failed................: 0.00% ✓ 0 ✗ 51
http_req_receiving.............: avg=16.95ms min=1.98ms med=14.89ms max=89.45ms p(90)=28.72ms p(95)=29.52ms
http_req_sending...............: avg=98.76µs min=38.06µs med=99.33µs max=147.64µs p(90)=114.39µs p(95)=116.33µs
http_req_tls_handshaking.......: avg=1.31ms min=0s med=0s max=67.17ms p(90)=0s p(95)=0s
http_req_waiting...............: avg=378.07ms min=28.23ms med=43.45ms max=16.13s p(90)=58.63ms p(95)=93.04ms
http_reqs......................: 51 0.721248/s
iteration_duration.............: avg=1.4s min=1.04s med=1.05s max=17.15s p(90)=1.07s p(95)=1.14s
iterations.....................: 50 0.707106/s
vus............................: 1 min=1 max=1
vus_max........................: 1 min=1 max=1
In my current script I use the check function like this:
check(response, {
'Status is 200': (r) => r.status === 200,
'Request duration is below 2s': (r) => r.http_req_duration < '2s'
})
I don’t want to use thresholds because there you can’t see how many requests took longer.
Has anybody an idea on how to do this?