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
3
votes
0 answers

Cant find kubernetes bottleneck

I am working on a project which has a goal to compare two architectures, monolithic and microservice. I built both apps, they both work fine, but the issue is in kubernetes. The app is a basic springboot app with H2 database. I test it using locust…
DavidS
  • 43
  • 3
3
votes
3 answers

Bash - how to retrieve exit status of first command in an 'or' statement

In a script in gitlab I have the following statement: locust || true This is because I don't want gitlab CI to stop the execution of the stage if the locust command fails with some exit code. But how can I nevertheless retrieve the exit code of the…
E Shindler
  • 425
  • 7
  • 27
3
votes
2 answers

Using Locust with pre-defined requests per second

Looking at load testing tools, I found Locust and immediately found it appealing as a Python guy, but I'm not entirely sure if I can achieve the following scenario with it... I'm tasked with load testing a REST API with real-life traffic. I've…
JK Laiho
  • 3,538
  • 6
  • 35
  • 42
3
votes
1 answer

Locust io and javascript

I need help with the following, I am trying to get a get from a page (it brings a client information), but said page has a javascript that is executed to monitor, the idea is that when I do the get I also execute said script. I have looked for some…
3
votes
3 answers

Locust, how to access custom command line argument from LoadTestShape

I create a listener for new command line argument: @events.init_command_line_parser.add_listener def init_parser(parser): parser.add_argument("--stages", type=str, env_var="LOCUST_STAGES", help="It's working") but I don't have a clue how to get…
Samolevar
  • 53
  • 7
3
votes
2 answers

Locust.io: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility

This is annoying, So I spent the past 15 hours trying to figure out why locust.io will not launch for me. On my mac machine, I am trying to get an example of locust running so I can begin my exploration of the package. I installed locust in my…
AndrewRoj
  • 97
  • 1
  • 8
3
votes
1 answer

Locust installation: psutil compilation failed with exit status 1 Python.h: No such file or directory

I am installing locust using command pip3 install locust. I am faced with a series of errors which I am unable to understand and debug, kindly help me with what went wrong. Any help is appreciated.I have python 3.8 and python 2.7 both installed on…
Saranya Gupta
  • 1,945
  • 2
  • 10
  • 14
3
votes
2 answers

Locust.io sequential task set not running sequentially

I am total newbie to Python. I am writing my first Python class this week to run Locust.io load test on our API. I have setup the code below. import random from locust import HttpUser, SequentialTaskSet, task, between from datetime import…
tcDev
  • 175
  • 2
  • 12
3
votes
1 answer

Problem updating Locust script to 1.x: TypeError: __init__() takes 1 positional argument but 2 were given

Having changed (0.x style) class MyBaseLocust(Locust): def __init__(self): super(MyLocust, self).__init__() to (1.x style) class MyBaseUser(User): def __init__(self): super(MyBaseUser, self).__init__() I get: [2020-07-17…
Cyberwiz
  • 11,027
  • 3
  • 20
  • 40
3
votes
1 answer

CPU Utilization while using locust

We are planning to use locust for performance testing. I have started locust in distributed mode on Kubernetes, with 800 Users for a duration of 5 minutes. Hatch rate is 100 as well. After a couple of minutes, I can see the below warning on the…
Hound
  • 837
  • 17
  • 31
3
votes
1 answer

Locust docker container cannot find the locust file

I try to run locustfile in locustio/locust docker image and it cannot find the locustfile, despite the locustfile exists in the locust directory. ~ docker run -p 8089:8089 -v $PWD:/locust locustio/locust locust -f /locust/locustfile.py Could not…
Cyberwiz
  • 11,027
  • 3
  • 20
  • 40
3
votes
2 answers

How can I use pythons request module with locust to load test bunch of apis

I have an existing api testing framework which uses requests module of python3. I decided to use locust module to load test my apis using the same framework. From what I understand locust uses its own client to make api calls. Is there a way where I…
Abhishek Malani
  • 93
  • 1
  • 11
3
votes
1 answer

Distributed locust load testing on local machine

I was wondering is it possible to run locust distributed on the local machine? I mean to create slaves and master locally. I tried next: Master: > locust --master Slaves: > locust --slave --master-host=127.0.0.1 --master-port=8089 But I am…
ramob-hamster
  • 51
  • 1
  • 4
3
votes
1 answer

Need a way to pass variables from User class to a TaskSet in Locust

I'm new to locust and I'm trying to write load tests. The purpose of my Locust Users would be to create an Item by calling a createItem API. In this scenario the item_id in each request should be unique as it has a unique criteria. This is what I've…
3
votes
2 answers

How to rename python locust actions?

I have the next code from locustio documentation: from locust import HttpLocust, TaskSet, between def login(l): l.client.post("/login", {"username":"ellen_key", "password":"education"}) def logout(l): l.client.post("/logout",…
SergeyMoroz
  • 117
  • 3
  • 11