Hello,
We want detailed logs in seconds - it helps us analyze RPS across a period of time and compare it to a bunch of interconnected services. Here’s what we did: we built a collector that streams data into a high throughput system. Now the sample that we get in the collector has data like this:
{"type":"Point","data":{"time":"**2021-03-05T18:47:13.059652-08:00**","value":0,"tags":{"group":"","method":"GET","name":"https://test-api.k6.io/","proto":"HTTP/2.0","status":"200","tls_version":"tls1.2","url":"https://test-api.k6.io/"}},"metric":"http_req_blocked"}
{"type":"Point","data":{"time":"**2021-03-05T18:47:13.059652-08:00**","value":0,"tags":{"group":"","method":"GET","name":"https://test-api.k6.io/","proto":"HTTP/2.0","status":"200","tls_version":"tls1.2","url":"https://test-api.k6.io/"}},"metric":"http_req_connecting"
For a specific metric, say “http-reqs” what’s the best way to accumulate the sample to seconds? Say if I had a Point json and 2 entries for http_reqs like this
{"type":"Point","data":{"time":"**2021-03-05T18:47:13.059652-08:00**",**"value":20,**"metric":"**http_reqs**"}
{"type":"Point","data":{"time":"**2021-03-05T18:47:13.059660-08:00**",**"value":23**,"metric":"**http_reqs**"}
If you see the above example there’s 2 lines for http_reqs for a specific second (split into milliseconds) -
2021-03-05T18:47:13 - millisecond A
2021-03-05T18:47:13 - millisecond B
Let us assume 2 different things are running k6 and they hit the endpoint with 2 different velocities at the same time, and its only a small millisecond diff or no diff at all.
I want to accumulate this data and say that at this second 2021-03-05T18:47:13 , the total number of http_reqs is 20+23 = 43.
Which is the best place to gather this in the collector? Is there anything k6 can do to help us get second wise samples?
End goal: For a test of say 10m, where first 5m it ramps up to 1000RPS and next 5m, it holds 1000RPS, we want to see this trend with timestamps from k6 through its logs. This has been beneficial for us.
Currently we are putting the detailed log as a json output - but if we run large tests this JSON is in the order of 25GB and above and k6 does not support rotating log mechanism.
Please suggest what’s the best approach.