Scalable user load testing tool written in Python

Overview

Locust

Build Status codecov license PyPI PyPI GitHub contributors

Locust is an easy to use, scriptable and scalable performance testing tool. You define the behaviour of your users in regular Python code, instead of using a clunky UI or domain specific language. This makes Locust infinitely expandable and very developer friendly.

Features

Write user test scenarios in plain-old Python

If you want your users to loop, perform some conditional behaviour or do some calculations, you just use the regular programming constructs provided by Python. Locust runs every user inside its own greenlet (a lightweight process/coroutine). This enables you to write your tests like normal (blocking) Python code instead of having to use callbacks or some other mechanism. Because your scenarios are “just python” you can use your regular IDE, and version control your tests as regular code (as opposed to some other tools that use XML or binary formats)

from locust import HttpUser, task, between

class QuickstartUser(HttpUser):
    wait_time = between(1, 2)

    def on_start(self):
        self.client.post("/login", json={"username":"foo", "password":"bar"})

    @task
    def hello_world(self):
        self.client.get("/hello")
        self.client.get("/world")

    @task(3)
    def view_item(self):
        for item_id in range(10):
            self.client.get(f"/item?id={item_id}", name="/item")

Distributed & Scalable - supports hundreds of thousands of users

Locust makes it easy to run load tests distributed over multiple machines. It is event-based (using gevent), which makes it possible for a single process to handle many thousands concurrent users. While there may be other tools that are capable of doing more requests per second on a given hardware, the low overhead of each Locust user makes it very suitable for testing highly concurrent workloads.

Web-based UI

Locust has a user friendly web interface that shows the progress of your test in real-time. You can even change the load while the test is running. It can also be run without the UI, making it easy to use for CI/CD testing.

Locust UI charts Locust UI stats Locust UI workers Locust UI start test

Can test any system

Even though Locust primarily works with web sites/services, it can be used to test almost any system or protocol. Just write a client for what you want to test, or explore some created by the community.

Hackable

Locust is small and very flexible and we intend to keep it that way. If you want to send reporting data to that database & graphing system you like, wrap calls to a REST API to handle the particulars of your system or run a totally custom load pattern, there is nothing stopping you!

Links

Authors

License

Open source licensed under the MIT license (see LICENSE file for details).

Comments
  • Move User selection responsibility from worker to master in order to fix unbalanced distribution of users and uneven ramp-up

    Move User selection responsibility from worker to master in order to fix unbalanced distribution of users and uneven ramp-up

    Fixes #1618 Fixes #896 Fixes #1635

    There's quite a lot of changes in this PR, but it was required to solve these two issues.

    Changes

    • New logic for computing the distribution of users (locust/distribution.py).
    • New logic for dispatching the users (locust/dispatch.py). The master is now responsible to compute the distribution of users and then dispatching a portion of this distribution to each worker. The spawn rate is also respected in distributed mode.
    • Possible breaking change: signature of spawning_complete event now takes user_class_occurrences instead of user_count.
    • Behaviour change: users are no longer stopped at a rate of spawn_rate. See the docstring of locust.dispatch.dispatch_users for the rationale behind this decision. The correct way to have a ramp down is to use the load test shape feature.

    Demo

    Example of a real distributed load test shape with 5 workers and a stop timeout of 30s: image image

    Load test shape profile for this run: | duration | users | spawn rate | | ------------- | ------------- | ------------- | | 2m | 5 | 1 | | 2m | 10 | 1 | | 2m | 15 | 1 | | 2m | 20 | 1 | | 5m | 25 | 1 | | 2m | 20 | 1 | | 2m | 15 | 1 | | 2m | 10 | 1 | | 2m | 1 | 1 | | 5m | 25 | 5 | | 2m | 1 | 1 | | 5m | 25 | 5 | | 2m | 1 | 1 |

    The ramp-up of each stage takes around 4-5s which correlates with the spawn rate of 1. Also, we can see that the users are gracefully stopped (or killed after the stop timeout of 30s). That's why the ramp-down have the small staircases instead of one single drop.

    Other

    I hope I did not break anything. All the tests are passing, but while running some real load tests (such as the one above), it seems like the users are not always properly stopped. I added an integration test in test_runners.TestMasterWorkerRunners.test_distributed_shape_with_stop_timeout and I can't seem to reproduce the issue, so I don't think this problem is caused by my changes. Let me know if you think it might be because of my changes. Otherwise, I will open a new issue with some idea I have that might help with this.

    opened by mboutet 108
  • Reviewing PRs

    Reviewing PRs

    what is the process for reviewing and accepting a PR with locust? I see a number of open PRs (including mine) that have been open for some time. I just trying to get an idea of when PRs will be merged or rejected into master or if the project is considered stable and not accepting PRs.

    opened by normanb 57
  • Allow a fixed RPS rate

    Allow a fixed RPS rate

    Description of issue / feature request

    Please allow specifying a fixed RPS rate.

    While the current model is nice for modelling users, it is not very useful for modelling more complex modern web applications which often will exhibit an exact known waiting behavior rather than something controlled by a more unpredictable distribution.

    Currently, I see no good way modelling this with locust and we are having huge trouble in our current project working around by guessing settings needlessly to roughly get to the actual RPS the web app knowingly sets off.

    Expected behavior

    RPS setting is available as alternative (including a way to guarantee e.g. exactly 1 request per second even if the actual request itself has a varying duration, e.g. a 200ms request response and a 500ms request response won't lead to strong variations of the interval)

    Actual behavior

    I can't find an RPS setting, and requests taking longer seems to make users wait more instead of allowing to have some sort of predictable fixed interval behavior (as is unrealistic for real users of course, but not unrealistic for many automated web clients).

    feature request 
    opened by ghost 56
  • error: argument --master-port: invalid int value bug

    error: argument --master-port: invalid int value bug

    Describe the bug

    locust: error: argument --master-port: invalid int value: 'tcp://172.30.44.4:8089'

    Expected behavior

    Locust runs correctly without producing this error. As --master-port wasn't even supplied.

    Actual behavior

    When invoking locust in master mode using the following: locust -f /scripts/locust-script.py --master the following error occurs locust: error: argument --master-port: invalid int value: 'tcp://172.30.44.4:8089'

    Steps to reproduce

    Start locust in the container using the command: locust -f /scripts/locust-script.py --master Error occurs.

    Environment settings

    • OS: RHEL
    • Python version: Python 3.6 from image registry.redhat.io/rhel8/python-36
    • Locust version: Using latest.
    opened by dbrennand 53
  • Re-introduce -n option to specify the number of requests

    Re-introduce -n option to specify the number of requests

    Description of issue

    Until locust v0.8, there was an option of -n to specify the number of requests. However, this was replaced by -t option in v0.9. We have a use case where we need to run a bunch of requests for a certain number of times and then take the median. To achieve this, we would want to limit the number of request to a certain value (using -n option). The time taken for each task would vary, so we cannot depend on time (-t option). Hence, requesting to re-introduce -n option back.

    Expected behavior

    TBD

    Actual behavior

    TBD

    Environment settings

    • OS:
    • Python version:
    • Locust version:

    Steps to reproduce (for bug reports)

    TBD - please provide example code

    feature request invalid 
    opened by gmhegde86 41
  • Provide an official Docker image

    Provide an official Docker image

    It'd be great if Locust provided an official Docker image on Dockerhub. Right now the most used image is hakobera/locust but it hasn't been updated in 3 years.

    feature request 
    opened by JDiPierro 40
  • Python 3 support

    Python 3 support

    Added support for Python 3 and running tests against all supported versions of Python with tox.

    Borrowed heavily from https://github.com/locustio/locust/pull/328 but cleaned things up & simplified some changes in the hopes that it will be more likely to be merged.

    opened by pmdarrow 40
  • OOM error with master/slaves setup (zeromq, windows)

    OOM error with master/slaves setup (zeromq, windows)

    Hi !

    Describe the bug

    An out of memory error occurs with ZeroMQ trying to allocate a crazy amount of memory in decoded_allocator, sometime up to several petabytes. This might very well be a ZeroMQ bug : OUT OF MEMORY (bundled\zeromq\src\decoder_allocators.cpp:89)

    I added some logs and recompiled pyzmq to check what's going on. Upon further investigation, _max_counters seems to take a crazy value at some point. See zmq_logs.txt As you can see, allocator instance 0x0000016A9270F700 is constructed with _max_counters=249, but before crash its value has changed to 1557249601288, which causes a malloc of several terabytes.

    Steps to reproduce

    Sorry, I couldn't find a surefire way to reproduce this one. It seems kind of random. It sometime happens before the test is even started, sometime when the test is stopped. Sometime it doesn't happen at all. It does seem to happen more often when stopping a test in the web UI. Simply run the ps1 attached and do some stuff in the web UI.

    Environment

    • OS: Windows 10.0.18362.778
    • Python version: 3.6
    • Locust version: 0.14.6
    • Locust files : test_locust.zip

    I managed to repro the bug on two computers : my work computer and my personal computer. Both are on Windows 10/Python 3.6 that comes with VS2017, but my personal computer has a pristine python environent, just ran pip install locustio.

    Am I doing something I'm not supposed to ?

    bug 
    opened by mparent 30
  • Locust Helm Chart update

    Locust Helm Chart update

    Hello guys. Thanx for developing great tools. Locust can be leveraged by Helm over Kubernetes with easy install. Unfortunately official helm chart for Locust is using Locust 0.9.0 image. I simply changed the image version to 0.13.5 but it didn't work. I suppose that there were some changes and the Helm chart needs to be updated followed by locust version up. Could you please update the helm chart for recent version of locust? Locust 0.9.0 seems to have different taskSet grammer etc

    waiting on contributor invalid stale 
    opened by bwcho75 29
  • Specify host in web ui

    Specify host in web ui

    Add support for specifying the hostname to test in the web ui, as opposed to in the command line.

    • Tests pass (had to make some changes there)
    • Hostname is now displayed in the UI (similar to https://github.com/locustio/locust/pull/295)
    • Updated docs to reflect that you no longer need to specify host in the command line
    priority 
    opened by PayscaleNateW 28
  • ft: LoadTestShapes with custom user classes

    ft: LoadTestShapes with custom user classes

    Hey Locust Team,

    I've been using locust for a while now, and really like to work with it. Still we achieved to run into some shortcomings for the project I am currently working on.

    With this PR I would like to propose a new feature:

    The possibility to create custom LoadTestShapes, where a step / tick only creates a specified set of users.

    Why I need this feature / other maybe also need it:

    In our Testscenario we need to make sure that a certain amount of locust users is definitely present upfront. Trying to achieve this with weighting or fixed_users is possible but from my experience also mixed with a bit of luck. As we are already using LoadTestShapes I asked myself, whether it is possible to include the users in the stages for example.

    How to use it:

    Using this would look like this for example:

    stages = [
            {"duration": 60, "users": 10, "spawn_rate": 10, "user_classes": [WebsiteUserA]},
            {"duration": 100, "users": 50, "spawn_rate": 10, "user_classes": [WebsiteUserB]},
            {"duration": 180, "users": 100, "spawn_rate": 10, "user_classes": [WebsiteUserA, WebsiteUserB]},
            {"duration": 220, "users": 30, "spawn_rate": 10},
        ]
    

    In this case the first step would only create users of the class WebsiteUserA, the second step WebsiteUserB and so on. I also included a new example called staging_user_classes.py.

    Is it backwards compatible:

    Yeah, it should be. If the "user_classes"-entry is missing, it will use all the existing user classes as input, as it was before.

    How it was achieved:

    I needed to adjust three files:

    • shape.py
    • runners.py
    • dispatch.py

    The maybe most important change (and maybe there's an even better solution for that) was, that in every new_dispatch() call (this happens for each tick / step once), also a new user_generator is being created. But in the end there were only a few minimal changes to the code done.

    I really am looking forward hearing your thought.

    Thanks a lot in advance.

    opened by samuelspagl 27
  • when I put a directory in the LOCUST_LOCUSTFILE environment variable, the shape class is read in duplicate.

    when I put a directory in the LOCUST_LOCUSTFILE environment variable, the shape class is read in duplicate.

    Describe the bug

    When I put a directory in the LOCUST_LOCUSTFILE environment variable, the shape class is read in duplicate.

    Expected behavior

    Read Shape Class properly.

    Actual behavior

    outputs "Duplicate shape classes: xxx" log. https://github.com/locustio/locust/blob/7591ed233a25687c3e7b1d386da86f0334cff90a/locust/main.py#L74

    Steps to reproduce

    I don't know why but There is nothing wrong with listing the files.(Like LOCUST_LOCUSTFILE: test1.py, test2.py..)

    Environment

    • OS: Linux
    • Python version: locustio/locust latest docker version
    • Locust version: 2.14.0
    bug 
    opened by lgs6813 1
  • Stats in json to stdout

    Stats in json to stdout

    I extended the cli with a --json argument. This argument prints the result of a run in json, after a run is finished. It blocks other INFO logs, so it's easy to interoperable with other programs. Below is an example with jq

    ❯ python -m locust -f examples/locustfile.py --host http://localhost:80 --headless -u 10 -t 4s --json
    [
        {
            "name": "/",
            "method": "GET",
            "last_request_timestamp": 1670363796.9102132,
            "start_time": 1670363793.665749,
            "num_requests": 8,
            "num_none_requests": 0,
            "num_failures": 0,
            "total_response_time": 61.882097012130544,
            "max_response_time": 18.852641980629414,
            "min_response_time": 3.2629000197630376,
            "total_content_length": 4920,
            "response_times": {
                "19": 1,
                "9": 1,
                "4": 3,
                "10": 1,
                "3": 1,
                "8": 1
            },
            "num_reqs_per_sec": {
                "1670363793": 1,
                "1670363794": 2,
                "1670363795": 1,
                "1670363796": 4
            },
            "num_fail_per_sec": {}
        }
    ]
    
    ❯ python -m locust -f examples/locustfile.py --host http://localhost:80 --headless -u 10 -t 4s --json | jq .[0].response_times
    {
      "11": 2,
      "10": 1,
      "4": 4,
      "9": 1
    }
    

    Locust: 2.13.2.dev11 Python: 3.10.8

    opened by AndersSpringborg 4
  • Fix: Enhance typing of the tasks attribute in the User class

    Fix: Enhance typing of the tasks attribute in the User class

    Description

    This PR fixes a minor typing issue in the User class, it is related to the issue #2256.

    The change

    The code is changed from:

    from
        tasks: List[TaskSet | Callable]  = []
    to
        tasks: List[TaskSet | Callable | Tuple]  | dict[Callable, int] = []
    
    opened by samuelspagl 3
  • Extend typing of

    Extend typing of "task" property of a locust user

    Describe the bug

    Creating a dictionary of Callable,int for the tasks attribute of a locust user is failing common python linters. (for example "mypy")

    Expected behavior

    The type hinting should be inline with the comment:

        Collection of python callables and/or TaskSet classes that the Locust user(s) will run.
    
        If tasks is a list, the task to be performed will be picked randomly.
    
        If tasks is a *(callable,int)* list of two-tuples, or a {callable:int} dict,
        the task to be performed will be picked randomly, but each task will be weighted
        according to its corresponding int value. So in the following case, *ThreadPage* will
        be fifteen times more likely to be picked than *write_post*::
    

    Actual behavior

    Resulting mypy error:

    Mypy: Incompatible types in assignment (expression has type "Dict[Callable[..., None], Any]", base class "User" defined the type as "List[Union[TaskSet, Callable[..., Any]]]") [assignment]
    

    Steps to reproduce

    I'm using as IDE and also have the mypy plugin active, therefore this error is shown in the IDE itself. But it should also be possible to just start the linting process for these lines.

    class SomeUser(FastHttpUser):
        tasks = {
            some_task_1: 12,
            some_task_2: 4,
            some_task_3: 6
        }
    ...
    

    Solution

    Extend the typing in the user class with the following:

    from
        tasks: List[TaskSet | Callable]  = []
    to
        tasks: List[TaskSet | Callable]  | dict[Callable, int] | Tuple = []
    

    Environment

    • OS: MacOS
    • Python version: 3.10
    • Locust version: 2.13.0

    Looking forward to your comments. :)

    bug 
    opened by samuelspagl 2
  • Make --host parameter always be optional

    Make --host parameter always be optional

    Right now, locust gives an error if a user with no host value is started and host parameter is not set - even if there are no requests made without full paths. Or if the requests being made are not even HTTP, so the host parameter is irrelevant.

    I'm considering changing this, so that we only raise an exception if a relative request is made with no host parameter set. This might be a little awkward in some cases (as the error is delayed), but overall I think this improves useability. I'll make it so that any such request aborts the test immediately.

    feature request stale 
    opened by cyberw 1
  • locust k8s operator

    locust k8s operator

    Is your feature request related to a problem? Please describe.

    Need for flexible, secure and easy to use distributed performance testing solution while enabling keeping in mind points like; cloud governance, k8s resource management, CI compatibility.

    Describe the solution you'd like

    A k8s operator

    Describe alternatives you've considered

    HELM. However, this is not optimal as it requires a lot of manipulation and dealing with a lot of different k8s resource types not to mention lack of governance when deployed in an organisation.

    Additional context

    In my company, we were interested in cloud based distributed performance testing. We ended up choosing “locust” as a tool and I wrote a kubernetes operator for it. As far as I know and searched, this simply doesn’t exist for locust today.The operator have been running on AWS EKS for months now and it is very stable and performant.

    The project was created to provide:

    • A friendly user interface "A simple k8s custom resource based on a CRD"
    • Ability to run a distributed performance testing
    • Only ask for needed cluster permissions (security)
    • Exposing a Prometheus endpoint for test metrics
    • Maintain cloud infrastructure governance i.e. when used in an organisation, it is possible to maintain the governance over the allocated / created resources.
    • Cloud native by design
    • Enablement of performance testing in CI / CD pipelines

    The project was inspired after doing an industry study / survey. The project was influenced in functionality by the k6 k8s operator.

    As the code really doesn't include anything exclusive to the company, Open sourcing it is not a problem and it is something that I would happily do.

    What is the "catch"? The only "catch" is that the project is written in Java. That being said, from a user perspective, the interface purely through k8s and users are not exposed to any java code. This is similar to how k8s and most operators are written in Go but non of k8s users need to know anything about Go.

    Looking forward to your feedback.

    feature request 
    opened by AbdelrhmanHamouda 15
Releases(2.14.0)
  • 2.14.0(Dec 13, 2022)

    Add rest method to FastHttpUser to facilitate easy REST/JSON API testing (https://docs.locust.io/en/stable/increase-performance.html#rest)

    What's Changed

    • GRPC example - rewrite using interceptor by @zifter in https://github.com/locustio/locust/pull/2272
    • Add RestUser by @cyberw in https://github.com/locustio/locust/pull/2273
    • Move the rest method into FastHttpUser instead of RestUser. by @cyberw in https://github.com/locustio/locust/pull/2274

    New Contributors

    • @zifter made their first contribution in https://github.com/locustio/locust/pull/2272

    Full Changelog: https://github.com/locustio/locust/compare/2.13.2...2.14.0

    Source code(tar.gz)
    Source code(zip)
  • 2.13.2(Dec 9, 2022)

    What's Changed

    • Fix: Ask worker to reconnect if master gets a broken RPC message by @marcinh in https://github.com/locustio/locust/pull/2271

    Full Changelog: https://github.com/locustio/locust/compare/2.13.1...2.13.2

    Source code(tar.gz)
    Source code(zip)
  • 2.13.1(Dec 1, 2022)

    Convert browser recordings into locustfiles automatically using har2locust! (documentation)

    What's Changed

    • Tiny performance enhancements by @cyberw in https://github.com/locustio/locust/pull/2240
    • Replace datetime.utcnow() with datetime.now(tz=timezone.utc), as it is kind of an antipattern by @cyberw in https://github.com/locustio/locust/pull/2244
    • Use C-style (percent) string formatting for all debug logging statements (improves performance) by @cyberw in https://github.com/locustio/locust/pull/2245
    • Update documentation for Environment.parsed_options by @klazuka in https://github.com/locustio/locust/pull/2247
    • Added a better working docker command for Windows users by @MagnusNordboe in https://github.com/locustio/locust/pull/2248
    • Small fixes to documentation by @jscanlannyc in https://github.com/locustio/locust/pull/2254
    • auto generated locustfiles from browser recordings using har2locust (documentation) by @cyberw in https://github.com/locustio/locust/pull/2259
    • Dont reset connection to worker if master receives a corrupted zmq message by @marcinh in https://github.com/locustio/locust/pull/2266

    New Contributors

    • @klazuka made their first contribution in https://github.com/locustio/locust/pull/2247
    • @MagnusNordboe made their first contribution in https://github.com/locustio/locust/pull/2248
    • @jscanlannyc made their first contribution in https://github.com/locustio/locust/pull/2254

    Full Changelog: https://github.com/locustio/locust/compare/2.13.0...2.13.1

    Source code(tar.gz)
    Source code(zip)
  • 2.13.0(Oct 28, 2022)

    What's Changed

    • Add the ability to set default_headers on FastHttpUser by @cyberw in https://github.com/locustio/locust/pull/2231
    • Make LoadTestShape a proper abstract class by @cyberw in https://github.com/locustio/locust/pull/2233
    • Web UI: URL link on the host name for fast navigation to the API by @JonanOribe in https://github.com/locustio/locust/pull/2228
    • Add support for time strings for --stop timeout (e.g. "5m30s") @cyberw in https://github.com/locustio/locust/pull/2239

    New Contributors

    • @JonanOribe made their first contribution in https://github.com/locustio/locust/pull/2228

    Full Changelog: https://github.com/locustio/locust/compare/2.12.2...2.13.0

    Source code(tar.gz)
    Source code(zip)
  • 2.12.2(Oct 15, 2022)

    What's Changed

    • Output install location and version info when called with -V by @cyberw in https://github.com/locustio/locust/pull/2213
    • Delete the CustomMessageListener class for type consistency by @samuelspagl in https://github.com/locustio/locust/pull/2221
    • Fix exception when someone sets both --headless and --autostart by @cyberw in https://github.com/locustio/locust/pull/2224
    • Run unit tests on Python 3.11 (and explicitly support it) by @cyberw in https://github.com/locustio/locust/pull/2225

    Full Changelog: https://github.com/locustio/locust/compare/2.12.1...2.12.2

    Source code(tar.gz)
    Source code(zip)
  • 2.12.1(Sep 21, 2022)

    What's Changed

    • fix: when run from web with -f a_file_folder/ caused page title is None as locustfile argument is None by @alterhu2020 in https://github.com/locustio/locust/pull/2175
    • Bump docker base image to Python 3.10 by @cyberw in https://github.com/locustio/locust/pull/2197
    • Fix parsed options user classes when using class picker by @mikenester in https://github.com/locustio/locust/pull/2201
    • Modernize type hints by @cyberw in https://github.com/locustio/locust/pull/2205
    • Bug Fix for User Class Count reset when editing a running test and using --class-picker by @mikenester in https://github.com/locustio/locust/pull/2207
    • Allow setting run time from the web UI / http api by @ajt89 in https://github.com/locustio/locust/pull/2202
    • stats summary refactoring by @SamPosh in https://github.com/locustio/locust/pull/2193
    • Second fix for --class-picker resetting user_count on edits by @mikenester in https://github.com/locustio/locust/pull/2210
    • black format info is added by @SamPosh in https://github.com/locustio/locust/pull/2212

    Full Changelog: https://github.com/locustio/locust/compare/2.12.0...2.12.1

    Source code(tar.gz)
    Source code(zip)
  • 2.12.0(Sep 7, 2022)

    What's Changed

    • Web UI style fixes: about dialog cannot be opened in the startup page by @alterhu2020 in https://github.com/locustio/locust/pull/2173
    • Bump default concurrency for fast http user to 10 by @cyberw in https://github.com/locustio/locust/pull/2177
    • Allow more recent versions of pyzmq (it was only 23.0.0 that was broken) by @cyberw in https://github.com/locustio/locust/pull/2179
    • Bump FastHttpUser/geventhttpclient dependency to 2.0.2 by @cyberw in https://github.com/locustio/locust/pull/2180
    • GitHub Workflows security hardening by @sashashura in https://github.com/locustio/locust/pull/2184
    • ft: LoadTestShapes with custom user classes by @samuelspagl in https://github.com/locustio/locust/pull/2181
    • Log warning if tag filtering gets rid of all tasks by @cyberw in https://github.com/locustio/locust/pull/2186

    New Contributors

    • @sashashura made their first contribution in https://github.com/locustio/locust/pull/2184
    • @samuelspagl made their first contribution in https://github.com/locustio/locust/pull/2181

    Full Changelog: https://github.com/locustio/locust/compare/2.11.1...2.12.0

    Source code(tar.gz)
    Source code(zip)
  • 2.11.1(Aug 25, 2022)

    What's Changed

    • Fix typo by @cclauss in https://github.com/locustio/locust/pull/2157
    • Upgrade GitHub Actions by @cclauss in https://github.com/locustio/locust/pull/2158
    • Include worker_index in worker connection logging, and stop using the word "client" for what is actually a worker by @cyberw in https://github.com/locustio/locust/pull/2159
    • Allow multiple definitions of same user class name if they come from the same place by @cyberw in https://github.com/locustio/locust/pull/2160
    • Fix broken link in cpu warning message. by @conghuiw in https://github.com/locustio/locust/pull/2164
    • Fix custom message example in documentation by @aathan in https://github.com/locustio/locust/pull/2165
    • fix: edit load test missing the userclasses data by @alterhu2020 in https://github.com/locustio/locust/pull/2171
    • Use more clear wording in --run-time reached stopping log message. by @cyberw in https://github.com/locustio/locust/pull/2172

    New Contributors

    • @conghuiw made their first contribution in https://github.com/locustio/locust/pull/2164
    • @aathan made their first contribution in https://github.com/locustio/locust/pull/2165
    • @alterhu2020 made their first contribution in https://github.com/locustio/locust/pull/2171

    Full Changelog: https://github.com/locustio/locust/compare/2.11.0...2.11.1

    Source code(tar.gz)
    Source code(zip)
  • 2.11.0(Aug 12, 2022)

    What's Changed

    • fix: Ensure new test starts with specified number of users after previous test has been stopped by @mboutet in https://github.com/locustio/locust/pull/2152
    • Pass multiple Locustfiles and allow selecting User and Shape class from the WebUI by @mikenester in https://github.com/locustio/locust/pull/2137
    • feat: add 'worker_index' to WorkerRunner by @gdm85 in https://github.com/locustio/locust/pull/2155

    New Contributors

    • @SamPosh made their first contribution in https://github.com/locustio/locust/pull/2156

    Full Changelog: https://github.com/locustio/locust/compare/2.10.2...2.11.0

    Source code(tar.gz)
    Source code(zip)
  • 2.10.2(Aug 3, 2022)

    What's Changed

    • Escape user supplied data in html report (#2126) by @herrmanntom in https://github.com/locustio/locust/pull/2127
    • Replace the MD5 usage by SHA256 by @RenanGBarreto in https://github.com/locustio/locust/pull/2130
    • Fix escaping for exceptions in normal web ui (related to #2126) by @herrmanntom in https://github.com/locustio/locust/pull/2131
    • fix: Fix typo at user/wait_time.py by @DmytroLitvinov in https://github.com/locustio/locust/pull/2133
    • Test Report: Implement table sorting by @Likqez in https://github.com/locustio/locust/pull/2134
    • Small documentation correction by @andybyrne in https://github.com/locustio/locust/pull/2138
    • Log a warning for failed attempts to connect to master by @gdm85 in https://github.com/locustio/locust/pull/2136
    • Minor edits to the documentation by @sosna in https://github.com/locustio/locust/pull/2140
    • Better error message when User.task is set instead of User.tasks by @cyberw in https://github.com/locustio/locust/pull/2142
    • style: add a report favicon by @Pactortester in https://github.com/locustio/locust/pull/2145
    • Fix for Flask 2.2.0 breaking changes by @mikenester in https://github.com/locustio/locust/pull/2148

    New Contributors

    • @herrmanntom made their first contribution in https://github.com/locustio/locust/pull/2127
    • @RenanGBarreto made their first contribution in https://github.com/locustio/locust/pull/2130
    • @DmytroLitvinov made their first contribution in https://github.com/locustio/locust/pull/2133
    • @Likqez made their first contribution in https://github.com/locustio/locust/pull/2134
    • @andybyrne made their first contribution in https://github.com/locustio/locust/pull/2138
    • @gdm85 made their first contribution in https://github.com/locustio/locust/pull/2136
    • @sosna made their first contribution in https://github.com/locustio/locust/pull/2140
    • @Pactortester made their first contribution in https://github.com/locustio/locust/pull/2145
    • @mikenester made their first contribution in https://github.com/locustio/locust/pull/2148

    Full Changelog: https://github.com/locustio/locust/compare/2.10.1...2.10.2

    Source code(tar.gz)
    Source code(zip)
  • 2.10.1(Jun 28, 2022)

    What's Changed

    • Increase CONNECT_RETRY_COUNT to avoid workers giving up too soon if master is not up yet by @cyberw in https://github.com/locustio/locust/pull/2125

    Full Changelog: https://github.com/locustio/locust/compare/2.10.0...2.10.1

    Source code(tar.gz)
    Source code(zip)
  • 2.10.0(Jun 27, 2022)

    What's Changed

    • Fix multiple resetting connection after RPCError by @Nosibb in https://github.com/locustio/locust/pull/2096
    • Stop client_listener from raising a KeyError when receiving a client_stopped message from unknown worker by @BirdLearn in https://github.com/locustio/locust/pull/2102
    • additional typing improvements by @mgor in https://github.com/locustio/locust/pull/2106
    • chore: Set permissions for GitHub actions by @naveensrinivasan in https://github.com/locustio/locust/pull/2107
    • Add ack for worker connection by @Nosibb in https://github.com/locustio/locust/pull/2077
    • fix: stopping state when running more than one worker node. by @renato-farias in https://github.com/locustio/locust/pull/2116
    • add support for custom SSLContext when using FastHttpUser by @renato-farias in https://github.com/locustio/locust/pull/2113
    • Update the link for reporting data to a database by @AlexMooney in https://github.com/locustio/locust/pull/2119
    • Convert url for getting tasks to relative by @5imun in https://github.com/locustio/locust/pull/2121
    • More robust handling of ZMQ/RPC errors by @solowalker27 in https://github.com/locustio/locust/pull/2120
    • Remove timeout parameter from FastHttpUser unit tests by @cyberw in https://github.com/locustio/locust/pull/2123

    New Contributors

    • @Nosibb made their first contribution in https://github.com/locustio/locust/pull/2096
    • @BirdLearn made their first contribution in https://github.com/locustio/locust/pull/2102
    • @naveensrinivasan made their first contribution in https://github.com/locustio/locust/pull/2107
    • @renato-farias made their first contribution in https://github.com/locustio/locust/pull/2116
    • @AlexMooney made their first contribution in https://github.com/locustio/locust/pull/2119
    • @5imun made their first contribution in https://github.com/locustio/locust/pull/2121

    Full Changelog: https://github.com/locustio/locust/compare/2.9.0...2.10.0

    Source code(tar.gz)
    Source code(zip)
  • 2.9.0(May 19, 2022)

    What's Changed

    • Ensure test_start is run to completion on worker by @mboutet in https://github.com/locustio/locust/pull/2072
    • modernized build by @mgor in https://github.com/locustio/locust/pull/2070
    • Drop support for Python 3.6 by @cyberw in https://github.com/locustio/locust/pull/2080
    • Add table linkage, you can see the data of the three tables at the sa… by @helloNice in https://github.com/locustio/locust/pull/2082
    • uniform style of stats/report ascii tables by @mgor in https://github.com/locustio/locust/pull/2084
    • Move CSV stats printer gevent spawn up a few lines by @max-rocket-internet in https://github.com/locustio/locust/pull/2085
    • FastHttpUser improvements (including a rename of parameter "url" to "path") by @mgor in https://github.com/locustio/locust/pull/2083
    • print_stats table width fix for #2084 by @mgor in https://github.com/locustio/locust/pull/2088
    • Remove explicit version requirement for jinja2 by @cyberw in https://github.com/locustio/locust/pull/2090
    • dispatch: rebalance users with a fixed count by @andydunstall in https://github.com/locustio/locust/pull/2093
    • avoid using pyzmq 23. Fixes #2099 by @cyberw in https://github.com/locustio/locust/pull/2100

    New Contributors

    • @helloNice made their first contribution in https://github.com/locustio/locust/pull/2082
    • @andydunstall made their first contribution in https://github.com/locustio/locust/pull/2093

    Full Changelog: https://github.com/locustio/locust/compare/2.8.6...2.9.0

    Source code(tar.gz)
    Source code(zip)
  • 2.8.6(Apr 7, 2022)

    What's Changed

    • Support sharing connection pools between users by @miedzinski in https://github.com/locustio/locust/pull/2059
    • Add cpu_warning event, so listeners can do some action when CPU usage is too high by @cyberw in https://github.com/locustio/locust/pull/2067

    New Contributors

    • @miedzinski made their first contribution in https://github.com/locustio/locust/pull/2060
    • @kurtmckee made their first contribution in https://github.com/locustio/locust/pull/2062
    • @chalex2k made their first contribution in https://github.com/locustio/locust/pull/2064

    Full Changelog: https://github.com/locustio/locust/compare/2.8.5...2.8.6

    Source code(tar.gz)
    Source code(zip)
  • 2.8.5(Mar 28, 2022)

    • Fix dependency: Dont use latest Jinja2 because it has breaking changes

    What's Changed

    • fix some typos by @cuishuang in https://github.com/locustio/locust/pull/2052

    New Contributors

    • @cuishuang made their first contribution in https://github.com/locustio/locust/pull/2052

    Full Changelog: https://github.com/locustio/locust/compare/2.8.4...2.8.5

    Source code(tar.gz)
    Source code(zip)
  • 2.8.4(Mar 15, 2022)

    What's Changed

    • Add test_stopping event by @marcinh in https://github.com/locustio/locust/pull/2033
    • fixed load/users getting distributed to missing worker by @radhakrishnaakamat in https://github.com/locustio/locust/pull/2010
    • Bugfix/1947 locust does not stop all users by @marcinh in https://github.com/locustio/locust/pull/2041
    • fixing mypy errors with loosest rules by @mgor in https://github.com/locustio/locust/pull/2040
    • Add quit event, used for getting locust's exit code just before exit by @DennisKrone in https://github.com/locustio/locust/pull/2049

    New Contributors

    • @marcinh made their first contribution in https://github.com/locustio/locust/pull/2033
    • @radhakrishnaakamat made their first contribution in https://github.com/locustio/locust/pull/2010
    • @mgor made their first contribution in https://github.com/locustio/locust/pull/2040

    Full Changelog: https://github.com/locustio/locust/compare/2.8.3...2.8.4

    Source code(tar.gz)
    Source code(zip)
  • 2.8.3(Feb 25, 2022)

    What's Changed

    • Bump minimum required gevent version to 20.12.1 by @cyberw in https://github.com/locustio/locust/pull/2023
    • Fix typos by @kianmeng in https://github.com/locustio/locust/pull/2022
    • Ensure users are distributed evently across hosts during ramp up by @cyberw in https://github.com/locustio/locust/pull/2025
    • Ran pyupgrade on the code base, removing various "Python2-isms". by @cyberw in https://github.com/locustio/locust/pull/2032

    Full Changelog: https://github.com/locustio/locust/compare/2.8.2...2.8.3

    Source code(tar.gz)
    Source code(zip)
  • 2.8.2(Feb 14, 2022)

    What's Changed

    • Fix locust version in docker image (lose the .dev0) by @cyberw in https://github.com/locustio/locust/pull/2014
    • Dockerfile: Fix permissions in venv to allow installing packages in derived images by @cyberw in https://github.com/locustio/locust/pull/2016

    Full Changelog: https://github.com/locustio/locust/compare/2.8.1...2.8.2

    Source code(tar.gz)
    Source code(zip)
  • 2.8.1(Feb 13, 2022)

    What's Changed

    • Dockerfile: use a builder image to further optimize image size by @cyberw in https://github.com/locustio/locust/pull/2013

    Full Changelog: https://github.com/locustio/locust/compare/2.8.0...2.8.1

    Source code(tar.gz)
    Source code(zip)
  • 2.8.0(Feb 13, 2022)

    Shrink Locust's docker image from 358MB to 95MB. Mainly by basing it on python3.9-slim instead of python3.9.

    What's Changed

    • Fix empty tasks section in UI and static report bug by @EzR1d3r in https://github.com/locustio/locust/pull/2001
    • Mark package as being typed and add some missing type hints by @RobertCraigie in https://github.com/locustio/locust/pull/2003
    • Fix link to distributed load generation documentation in CPU log warning by @mayaCostantini in https://github.com/locustio/locust/pull/2007
    • Shrink docker image, mainly by switching base image to python3.9-slim by @cyberw in https://github.com/locustio/locust/pull/2009
    • Dockerfile: only install build dependencies on arm64 (everyone else has pre-built wheels) by @cyberw in https://github.com/locustio/locust/pull/2011

    New Contributors

    • @RobertCraigie made their first contribution in https://github.com/locustio/locust/pull/2003
    • @mayaCostantini made their first contribution in https://github.com/locustio/locust/pull/2007

    Full Changelog: https://github.com/locustio/locust/compare/2.7.3...2.8.0

    Source code(tar.gz)
    Source code(zip)
  • 2.7.3(Feb 6, 2022)

    What's Changed

    • Fix 'Tasks' section remains empty in web ui @tyge68 in https://github.com/locustio/locust/pull/1997
    • Support locust-plugin's Playwright User: Import trio before gevent patching if LOCUST_PLAYWRIGHT is set by @cyberw in https://github.com/locustio/locust/pull/1999

    Full Changelog: https://github.com/locustio/locust/compare/2.7.2...2.7.3

    Source code(tar.gz)
    Source code(zip)
  • 2.7.2(Feb 3, 2022)

    Fix issue with Locust completely shutting down on stop clicked in the web UI (a bug introduced in 2.7.1)

    What's Changed

    • Reverse parts of PR #1992 by @cyberw in https://github.com/locustio/locust/pull/1996

    Full Changelog: https://github.com/locustio/locust/compare/2.7.1...2.7.2

    Source code(tar.gz)
    Source code(zip)
  • 2.7.1(Feb 2, 2022)

    What's Changed

    • fix --html report in web mode by @uddmorningsun in https://github.com/locustio/locust/pull/1992
    • Allow repeated runs of run_single_user by @cyberw in https://github.com/locustio/locust/pull/1993
    • Send a tweet whenever there is a new release (testing this is actually the main purpose of this release :)

    Full Changelog: https://github.com/locustio/locust/compare/2.7.0...2.7.1

    Source code(tar.gz)
    Source code(zip)
  • 2.7.0(Jan 29, 2022)

    What's Changed

    • Add run_single_user and documentation on how to debug Users/locustfiles by @cyberw in https://github.com/locustio/locust/pull/1985
    • Fix "socket operation on non-socket" at shutdown, by reverting #1935 by @cyberw in https://github.com/locustio/locust/pull/1991

    Small fixes/improvements:

    • Fixing issue #1961 with incorrect "All users spawned" log messages wh… by @EzR1d3r in https://github.com/locustio/locust/pull/1977
    • unit tests: add extra validations in integration tests by @cyberw in https://github.com/locustio/locust/pull/1990
    • Add 99%ile for Web UI by @FooQoo in https://github.com/locustio/locust/pull/1989
    • hardening Environment.shape_class for distinct usage by @uddmorningsun in https://github.com/locustio/locust/pull/1983

    Full Changelog: https://github.com/locustio/locust/compare/2.6.1...2.7.0

    Source code(tar.gz)
    Source code(zip)
  • 2.6.1(Jan 26, 2022)

  • 2.6.0(Jan 23, 2022)

    • fixed_count: ability to spawn a specific number of users (as opposed to just using weights) #1964
    • Pass tags and exclude-tags to workers. #1976
    • WorkerRunner: read --expect-workers from job parameters #1975
    • Clean up some logging messages #1973
    • Ensure heartbeat_worker doesnt try to re-establish connection to workers when quit has been called #1972
    Source code(tar.gz)
    Source code(zip)
  • 2.5.1(Dec 9, 2021)

    • Ignore empty host field in web ui (Fix running the web UI with class defined hosts) (https://github.com/locustio/locust/pull/1956)
    • Throw exception when calling response.success()/.failure() if with-block has not been entered (https://github.com/locustio/locust/pull/1955)
    • Stop declaring "fake" class level variables in Environment, User and StatsEntry (https://github.com/locustio/locust/pull/1948)
    Source code(tar.gz)
    Source code(zip)
  • 2.5.0(Nov 5, 2021)

    • Change request event 'url' parameter to contain full URL (technically a breaking change, but very few users will have had time to start using this) (https://github.com/locustio/locust/issues/1927)
    • Suppress warnings for patch version mismatch between master and worker (https://github.com/locustio/locust/issues/1926)
    Source code(tar.gz)
    Source code(zip)
  • 2.4.3(Nov 2, 2021)

  • 2.4.2(Nov 1, 2021)

    • Add --expect-workers-max-wait parameter (https://github.com/locustio/locust/pull/1922)
    • Track worker memory usage (https://github.com/locustio/locust/pull/1917)
    • Other small fixes
    Source code(tar.gz)
    Source code(zip)
Mixer -- Is a fixtures replacement. Supported Django, Flask, SqlAlchemy and custom python objects.

The Mixer is a helper to generate instances of Django or SQLAlchemy models. It's useful for testing and fixture replacement. Fast and convenient test-

Kirill Klenov 871 Dec 25, 2022
A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.

PyAutoGUI PyAutoGUI is a cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard. pip inst

Al Sweigart 7.6k Jan 01, 2023
FastWSGI - An ultra fast WSGI server for Python 3

FastWSGI - An ultra fast WSGI server for Python 3

James Roberts 343 Dec 22, 2022
A mocking library for requests

httmock A mocking library for requests for Python 2.7 and 3.4+. Installation pip install httmock Or, if you are a Gentoo user: emerge dev-python/httm

Patryk Zawadzki 452 Dec 28, 2022
a socket mock framework - for all kinds of socket animals, web-clients included

mocket /mɔˈkɛt/ A socket mock framework for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support ...and then MicroPytho

Giorgio Salluzzo 249 Dec 14, 2022
ASGI specification and utilities

asgiref ASGI is a standard for Python asynchronous web apps and servers to communicate with each other, and positioned as an asynchronous successor to

Django 1.1k Dec 29, 2022
The lightning-fast ASGI server. 🦄

The lightning-fast ASGI server. Documentation: https://www.uvicorn.org Community: https://discuss.encode.io/c/uvicorn Requirements: Python 3.6+ (For P

Encode 6k Jan 03, 2023
Meinheld is a high performance asynchronous WSGI Web Server (based on picoev)

What's this This is a high performance python wsgi web server. And Meinheld is a WSGI compliant web server. (PEP333 and PEP3333 supported) You can als

Yutaka Matsubara 1.4k Jan 01, 2023
PyQaver is a PHP like WebServer for Python.

PyQaver is a PHP like WebServer for Python.

Dev Bash 7 Apr 25, 2022
livereload server in python (MAINTAINERS NEEDED)

LiveReload Reload webpages on changes, without hitting refresh in your browser. Installation python-livereload is for web developers who know Python,

Hsiaoming Yang 977 Dec 14, 2022
HTTP client mocking tool for Python - inspired by Fakeweb for Ruby

HTTPretty 1.0.5 HTTP Client mocking tool for Python created by Gabriel Falcão . It provides a full fake TCP socket module. Inspired by FakeWeb Github

Gabriel Falcão 2k Jan 06, 2023
The successor to nose, based on unittest2

Welcome to nose2 nose2 is the successor to nose. It's unittest with plugins. nose2 is a new project and does not support all of the features of nose.

738 Jan 09, 2023
Waitress - A WSGI server for Python 2 and 3

Waitress Waitress is a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones which live in t

Pylons Project 1.2k Dec 30, 2022
Green is a clean, colorful, fast python test runner.

Green -- A clean, colorful, fast python test runner. Features Clean - Low redundancy in output. Result statistics for each test is vertically aligned.

Nathan Stocks 756 Dec 22, 2022
gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications.

Gunicorn Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn

Benoit Chesneau 8.7k Jan 01, 2023
No longer maintained, please migrate to model_bakery

Model Mommy: Smart fixtures for better tests IMPORTANT: Model Mommy is no longer maintained and was replaced by Model Bakery. Please, consider migrati

Bernardo Fontes 917 Oct 04, 2022
Scalable user load testing tool written in Python

Locust Locust is an easy to use, scriptable and scalable performance testing tool. You define the behaviour of your users in regular Python code, inst

Locust.io 20.4k Jan 08, 2023
A utility for mocking out the Python Requests library.

Responses A utility library for mocking out the requests Python library. Note Responses requires Python 2.7 or newer, and requests = 2.0 Installing p

Sentry 3.8k Jan 02, 2023
create custom test databases that are populated with fake data

About Generate fake but valid data filled databases for test purposes using most popular patterns(AFAIK). Current support is sqlite, mysql, postgresql

Emir Ozer 2.2k Jan 06, 2023
An HTTP server to easily download and upload files.

httpsweet An HTTP server to easily download and upload files. It was created with flexibility in mind, allowing be used in many different situations,

Eloy 17 Dec 23, 2022