Skip to content
Advertisement

Tag: locust

ModuleNotFoundError : No module named with locust

When I try to import external library of my project in my locust python file, each time I have the error “ModuleNotFoundError : No module name ‘…’. Apparently is not clear but locust is installed and works. I have a task to make REST API call and it’s ok. But I need to make some action in the init method

Is it possible to run code after finishing a locust instance?

Let’s say this is the primary file I would run in terminal i.e locusts -f main.py. Is it possible to have it also run code after the locust instance is terminated or when time limit is reached? Possibly a cleanup script or sending the csv reports generated somewhere. Answer There is a test_stop event (https://docs.locust.io/en/stable/extending-locust.html) as well as a quitting

Locust: How to use distributed mode programmatically

I’m using locust to load test a bunch of apps, the problem is that it’s using more than 90% of the CPU and so I want to switch to distributed mode with master and workers, I know how it’s done in command line but I’m using locust as a library and it seems the docs don’t cover this case, here’s

Formatting Json for Python LocustIO

Why am I getting bad request for this post calls? It has to do with json formatting. How do I reformat the json object passed as param? I’m running a load test using LocustIO and Python. Answer json.dumps takes as input json object (lists & dictionaries) and serializes it giving a string as output. You are feeding it with nameInquiry,

Advertisement