Questions tagged [locust]

Locust is a Python based load testing framework (http://locust.io/)

Locust is an open source load testing tool, where user behaviour is defined in pure Python code

862 questions
5
votes
1 answer

How to write Event hooks in locust for response times of Individual requests

I am planning to test my web server for performance using locust, The problem with the below code is that it is only giving me the average times My basic code is as follows from locust import HttpLocust, TaskSet, task, events, web def index(l): …
Juggernaut17
  • 71
  • 1
  • 6
5
votes
2 answers

How can I get useful load testing data for my AWS server?

I have a system set up on AWS where I have a set of ec2 insatnces (as an application server from an elastic beanstalk) running in an auto-scaling load-balanced environment. All this works fine. I would like to load test this instance in order to…
Theyna
  • 317
  • 4
  • 12
5
votes
1 answer

Load testing bottleneck on nodejs with Google Compute Engine

I cannot figure out what is the cause of the bottleneck on this site, very bad response times once about 400 users reached. The site is on Google compute engine, using an instance group, with network load balancing. We created the project with…
4
votes
2 answers

How to output csv in locust when using as library?

I'm using locust as a library in my Python script (from the example in the docs) and I want to output the stats data into a CSV file. I found out that there is a StatsCSVFileWriter class and created it, but I don't know how to "tell" it to write the…
Angi2412
  • 81
  • 6
4
votes
3 answers

Can't run locust in debug mode

Recently I switched from old locust version (0.14.2) to 1.3.1. Previously I was able to run in debug mode with command WebsiteUser().run() and it stops on all breakpoints. When I try to run new version with the same command I get next error: File…
desmo
  • 43
  • 1
  • 6
4
votes
1 answer

"Locust command not found" returns even after I have installed Locust on Ubuntu

I have installed locust using the pip command and when I move forward towards verifying the installation using this command: locust -v , it throws the following line back: Command Not Found Secondly, when I installed Locust, some statements showed…
4
votes
1 answer

Google Compute Engine Automated Load Test VM Instance?

I have a simple web server application in a docker container that I have pinned to a vm instance in GCP Compute Engine. I am wondering how to set up automated load testing (Locust load testing via GKE) on the web server application running on my VM…
4
votes
0 answers

How should I use locust to write stress tests for WebSocket

1.how should i keep-alive? 2.How to calculate the response time? I rewrote loust according to online blog class WebSocketClient(object): def __init__(self, host): self.host = host self.ws = websocket.WebSocket() def…
Zoe Zou
  • 41
  • 3
4
votes
2 answers

How load test apollo server with locust?

Does anyone know how to load test the Apollo server? class UserBehavior(TaskSet): def on_start(self): self.login() @task def login(self): headers = {"content-type": "application/json"} …
Sujin Shrestha
  • 1,203
  • 2
  • 13
  • 23
4
votes
2 answers

Unable to scale Gunicorn/Flask HelloWorld over 125 RPS

I have a Flask app that I have been unable to scale past 125 RPS locally. It is a simple 'hello world' as seen below. I'm using the Locust.io load testing tool. I have pointed the same load test to a local Golang hello world, and am able to get…
CptJero
  • 151
  • 7
4
votes
1 answer

Issue while passing data from one task function to another in locust with sequential task one by one

We are trying to achieve a user-scenatio based load testing which basically creates an order in one url and then we have to pass the order id in the next url to get the status of that order. We are using locust sequential task for it. As we want it…
mohit
  • 2,325
  • 23
  • 48
4
votes
1 answer

Locust: how to specify a get request who takes query parameter

I want to load test my get request which is http://localhost:8080/v1/synonyms/project/?keyword=dealer and test method is @task(2) def get_synonym(self): response = self.client.get("/v1/synonyms/project/") print("Response status code:",…
Rajat
  • 2,467
  • 2
  • 29
  • 38
4
votes
1 answer

locust-TaskSet class vs function task

I'm new to locust and I'm trying to write load tests. I was wondering what is the difference between defining the tasks I want to do as callable functions rather then defining them as locust TaskSet classes. for example: class MyTaskSet(TaskSet): …
4
votes
2 answers

Locust: Understanding cookie creation while using locust login

I am trying to use locust for login to my web application. I am at very beginning of using locust. I am using the following code for login to application. post_data = {'username': username, 'password': password,'Submit':'Login' } with…
user168983
  • 822
  • 2
  • 10
  • 27
4
votes
2 answers

Integrating LocustIO results in Jenkins' performance plugin

I am using Locust to fire a large number of queries to an api. The results of this process are saved as the normal csv files. Since I am running Locust through command line, I have rewritten the response writer and used it directly in my test…
Abhinav
  • 992
  • 2
  • 11
  • 26