domsolutions / xk6-fasthttp

A k6 extension using fasthttp library for improved speed of HTTP/1.1 requests
Apache License 2.0
2 stars 1 forks source link

Emit same metrics that standard HTTP client emits #7

Open mprokopjc opened 6 months ago

mprokopjc commented 6 months ago

Hey! Thanks for a great extension. It looks very promising and I love that it give people an option to create multiple HTTP clients - for instance per vu. This unlock a way to test API protected by mTLS (each client has different cert).

When I gave this extension a try, I noticed that standard request metrics (http_req*) are not collected. For instance, when I run a sample k6 test with classic k6 HTTP client, I can see following output:

image

...while with the extension, you get only:

image

Would it be possible to collect those as well? As it is critical visibility piece for majority of perf test. Thanks!

domsolutions commented 6 months ago

Hi @mprokopjc

Thanks for your feedback. You should get a few more metrics if you run more than 1 req i.e:

./k6 run -u 250 -d 10s -q ./file-stream-upload.js 

     ✓ check status is 200

     checks...............: 100.00% ✓ 117129       ✗ 0    
     data_received........: 0 B     0 B/s
     data_sent............: 0 B     0 B/s
     http_req_duration....: avg=20.44ms min=223.18µs med=12.93ms max=1.38s p(90)=41.39ms p(95)=55.58ms
     http_reqs............: 116879  11671.351065/s
     iteration_duration...: avg=21.17ms min=311.78µs med=13.5ms  max=1.38s p(90)=43.01ms p(95)=57.71ms
     iterations...........: 117129  11696.315668/s
     vus..................: 250     min=250        max=250
     vus_max..............: 250     min=250        max=250

But indeed we are missing a lot of metrics, this is mentioned on the README and is due to a restriction on the fasthttp package which doesn't allow us to record these metrics.

I will try to work on this when I get some time, thanks!