Skip to content

celinenicolas22/locust-plugins

 
 

Repository files navigation

Locust Plugins

The purpose of this project is to gather a curated set of plugins/extensions for Locust.

Locust itself is a "bare bones" load generation tool (compared to for example JMeter or Gatling) and it is left to the user to build even basic functionality (like reading test data from a database, limiting the request rate to a certain value, etc). Forcing everyone to reinvent the wheel is a big waste, and makes using Locust harder than it needs to be.

So I decided to publish my own plugins and hope that others (maybe you?) will contribute their solutions to common Locust use cases.

Having this separate from "Locust core" allows the plugins to evolve faster (at the expense of being less mature), and avoids bloating Locust with functionality you might not be interested in.

The plugins are grouped by type:

  • listeners (request logging & graphing)
  • locusts (new protocols like websockets & selenium/webdriver)
  • readers (ways to get test data into your tests)
  • tasksets (support for RPS limiting, and maybe other task sets in the future)
  • utils (other stuff, like VS Code debugging support)

You can also have a look at the example locustfiles to learn how to use the plugins.

These plugins work well together with locust-swarm

Prerequisites

Many plugins use Postgres, and locust-plugins itself needs at least a Postgres client installed.

RedHat/CentOS:

yum install python3-devel postgresql-devel

MacOS:

brew install postgres

You can use several plugins without actually using Postgres (so setting up a database is not strictly necessary), but some of the core components like PostgresReader and TimescaleListener use it.

Installation

pip install locust-plugins

Configuration

Configuration is mostly done through environment variables. You will get an exception if one is missing, and they should either be self-explanatory, or explained in the code where they are used. I recommend setting them permanently in your bash profile, so you dont have to set them every time or make your command line super-long.

Contributions

Contributions are very welcome! 😁

For guidelines, see CONTRIBUTING.md

License

Copyright 2019 AB SvenskaSpel

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A set of useful plugins/extensions for Locust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.4%
  • Makefile 0.6%