Minimizing log file entries

Hi All,

I have been running a series of comparison tests from jmeter to K6 and am finding that using the same injection infrastructure am running out of disk space on my injectors :frowning:

I do see that for each call I make is resulting in around 12 lines in the output csv file.

http_reqs, http_req_duration, http_req_blocked, http_req_connecting, http_req_tls_handshaking, http_req_sending, http_req_waiting, http_req_receiving, http_req_failed, MyTrendTransaction, checks, checks.

Was hoping to be able to pretty much only capture metrics I have added as trends and included the above details (and response body size) into a single record THEN suppress the rest.

Is this possible?

Unfortunately, this is currently not possible :disappointed: It’s high on our priority list, but there are some prerequisite changes we need to make before we get to it… Follow Add explicit tracking and ignoring of metrics and sub-metrics · Issue #1321 · grafana/k6 · GitHub for updates, and maybe share your specific use case there as a data point?

@BobRuub have you tried using compressing the csv data through adding .gz to the end this will likely elevate some of the disk requirements.

Other than that, I can only recommend that you play with fifo pipes and filter things this way:

mkfifo pipe 
cat < pipe | grep 'http_req_duration' >new.csv & // change filtering to what you want, you can also compress through gzip here as well
k6 run -o csv=pipe script.js
rm pipe // some cleanup

k6 will write EOF so the cat/grep filtering process will also stop with k6.

Hope this helps.

Thanks for the response.

I’ll have a crack at the piping solution as it looks like the best bet in the short term.