pythonlocust

Most simple config not working for locust


This command works fine

locust --headless --users 10 --spawn-rate 1 -H http://localhost:3000

locustfile.py looks like that

from locust import HttpUser, task


class HelloWorldUser(HttpUser):
    @task
    def hello_world(self):
        self.client.get("/health")

but putting the same code in a local.py and this to a local.conf

locustfile = local.py
headless = true
master = true
expect-workers = 3
host = "http://localhost:3000"
users = 3
spawn-rate = 1
run-time = 1m

that command runs but does not bring back any results

locust --config local.conf

any idea why ?


Solution

  • This minimal file did work. As I have used tags in the config file which did not exist in the local.py. Also the master and workers entry did expect distributed load infrastructure

    locustfile = load_basics.py
    headless = true
    host = "http://localhost:50505"
    users = 1
    spawn-rate = 1
    run-time = 1m