alteryx / locust-grasshopper

a load testing tool extended from locust
Apache License 2.0
177 stars 9 forks source link

stages shapes QOL improvements #24

Closed jmfiola closed 1 year ago

jmfiola commented 1 year ago

This PR introduces feature of YAML-defined custom stages. This also changes how duration is interpreted slightly, to make the stages more intuitive. E.g, before, stage durations were defined like this in order to get a bunch of 60 second stages:

stages = [
        {"duration": 60, "users": 1, "spawn_rate": 1},
        {"duration": 120, "users": 2, "spawn_rate": 2},
        {"duration": 240, "users": 3, "spawn_rate": 3},
        {"duration": 300, "users": 4, "spawn_rate": 4},
        {"duration": 360, "users": 3, "spawn_rate": 1},
        {"duration": 420, "users": 1, "spawn_rate": 1},
    ]

Now, its:

stages = [
        {"duration": 60, "users": 1, "spawn_rate": 1},
        {"duration": 60, "users": 2, "spawn_rate": 2},
        {"duration": 60, "users": 3, "spawn_rate": 3},
        {"duration": 60, "users": 4, "spawn_rate": 4},
        {"duration": 60, "users": 3, "spawn_rate": 1},
        {"duration": 60, "users": 1, "spawn_rate": 1},
    ]