Specifying weights with http.batch and separate request functions

I’m new to k6 and doing research with scripted load testing platforms. I’m wondering if the multiple requests specified with http.batch can have weights applied to them? For example, say I have 3 requests, and the first I want to run 60% of the time, and the other two 20% of the time, how would I do that?

Also, I’ll be performance testing a complex api, is there a way to group a set of http requests into a common function and batch those functions?

Have you looked at the new scenarios in k6 v0.27.0? They offer both a way to “group a set of http requests into a common function” (put them in a scenario), and to “batch those functions” (multiple scenarios can be executed in parallel), and “can have weights applied to them” - you can specify a different number of looping VUs or iterations per second (which might be more appropriate for an API test) for each scenario. More details: