Hey k6 people,
I am new to k6 and just load testing in general. I am trying to create a spike test to test multiple API endpoints. The goal is to see how my system behaves if there is suddenly huge load on all endpoints.
So far everything seems to be working fine however i’m not quite sure if I should use http.request or http.batch - like what the right approach is(?) I want the test to mimic a real scenario where lots of users request data at the same time.
My understanding of http.batch is that it is used for testing multiple endpoints that are related - similar to how a web browser would load a website, its css, scripts and whatnot.
But would it make sense to use it for endpoints that aren’t really related and would that be “realistic”?
Or should I rather loop over my endpoints and call http.request for each of them separately.
I hope I am making sense otherwise please let me know and I’ll try to elborate better.
I have tried to look up examples of how to test multiple API endpoints at the same time, but haven’t had any luck so far, so if anyone knows a place to look please feel free to share.
Thanks in advance.