Skip to main content

Mite

Python 3.10 Python 3.11 Python 3.12 Python 3.13 Python 3.14 Docs

Hatch project linting - Ruff MIT license


Load Testing Framework

Mite is a load testing framework with distributed components written in Python. Requests are executed asynchronously, allowing large throughput from relatively small infrastructure.

Installation

pip install mite

This requires that you have libcurl installed on your system (including C header files for development, which are often distributed separately from the shared libraries). On Ubuntu, this can be accomplished with the command:

sudo apt install libcurl4 libcurl4-openssl-dev

(NB we use a version of libcurl linked against openssl rather than gnutls. This was originally because gnutls had high memory usage; that issue has since been resolved, so use whichever you prefer)

You can also use the dockerfile included in this repository to run mite. In order to get a shell in a container with mite installed, run these commands (assuming you have docker installed on your machine):

docker build -t mite .
docker run --rm -it mite sh

Run mite --help for a full list of commands

Optional install extras

pip install mite already installs every integration mite ships. The extras below are installable labels only, added ahead of a future major release that will actually make them optional. Today, installing any of them (or none) installs exactly the same packages:

Extra Covers
kafka Kafka integration (aiokafka)
amqp AMQP/RabbitMQ integration (aio_pika)
finagle Finagle/Thrift integration (thrift)
selenium Selenium WebDriver integration
selenium_wire Selenium with request/response capture (selenium-wire)
s3 S3-backed datapools (boto3)
db SQL-backed datapools (sqlalchemy)
websocket WebSocket integration
http HTTP integration (httpperf)
browser Browser/HTML-scraping integration (depends on http)
all Union of the above
pip install 'mite[kafka]'
pip install 'mite[all]'

(quote the brackets so your shell doesn't treat them as a glob)

This list doesn't include playwright, otel, influxdb, or dev; playwright needs a separate playwright install step to download browser binaries so it isn't installed by any extra; otel, influxdb, and dev are separate, pre-existing extras unrelated to this list. Every extra above is currently a functional no-op: all of their packages are still in mite's mandatory dependency list, so pip install 'mite[kafka]' installs exactly what pip install mite installs. They only become meaningful once a future major release actually removes packages from the default install.

Your first scenario

A scenario combines three things: a set of journeys to run, a datapool supplying test data to those journeys (if applicable), and a volume model describing how much load to apply.

A journey is an async python function holding the logic of what you want to do:

import asyncio

async def journey(ctx, arg1, arg2):
    async with ctx.transaction('test1'):
        ctx.send('test_message', content=ctx.config.get('test_msg', 'Not set'), sum=arg1 + arg2)
        await asyncio.sleep(0.5)

A datapool supplies the journey's arguments, and a volume model says how many copies of it to run in a given window of time:

from mite.datapools import RecyclableIterableDataPool

datapool = RecyclableIterableDataPool([(i, i+2) for i in range(5000)])
volumemodel = lambda start, end: 10

A scenario packages them together:

def scenario():
    return [
        ['mite.example:journey', datapool, volumemodel],
    ]

Test the journey on its own first, then run the whole scenario:

MITE_CONF_test_msg="Hello from mite" mite journey test mite.example:journey mite.example:datapool
MITE_CONF_test_msg="Hello from mite" mite scenario test mite.example:scenario

The full walkthrough — the journey context, custom datapools, debugging with --debugging, and the volume model DSL — is in Your first scenario in the documentation.

Distributed deployments

In order to scale up miteʼs capability to inject load, you will need to run it as a distributed suite of components. You can learn more about how to accomplish this in the documentation.

Deploy distributed mite with docker compose

Build mite image:

docker build -t mite .

Run mite deployments:

Use make from mite/local dir:

make up # start mite containers
make status # check status of mite containers
make clean # remove all mite containers

or

docker-compose -f docker_compose.yml up

For more information on distributed mite usage, info

Maintainers

If you run into any trouble or need support getting to grips with Mite, reach out on Slack if you work at Sky, or contact one of the maintainers if you're an external contributer:

Jordan Brennan
Jordan Brennan

💻
Aaron Ecay
Aaron Ecay

💻
Davide Annunziata
Davide Annunziata

💻
Ryan Linnit
Ryan Linnit

💻

Special thanks to the following contributors:

Metadata

Release files for mite 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mite 3.0.1
File Size Uploaded Provenance Actions
mite-3.0.1.tar.gz 2.3 MB Without provenance Details for mite-3.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mite 3.0.1
File Interpreter ABI Platform Actions
mite-3.0.1-py3-none-any.whl Python 3 none any Details for mite-3.0.1-py3-none-any.whl

Total release size: 2.4 MB

Release files / mite-3.0.1.tar.gz

Download URL mite-3.0.1.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
09538c44f6bf88d6062241de337fa1cf866ed2b4f1664dbec0bd76b7bd78ea07
BLAKE2b-256 checksum
How to use checksums
c47711a0a66af29c56c2ea958d7d5f1854eca8fa2d6a1e3607632de1b6e03b22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / mite-3.0.1-py3-none-any.whl

Download URL mite-3.0.1-py3-none-any.whl
Size 108.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0130b4c4dd743b6b50b666362873c2938d9567271063a1b96ce0c5278d535b38
BLAKE2b-256 checksum
How to use checksums
b7d6be32f3c9cbf3a6bf29726baca3cdb6a2f477058e38454c18c174457e7b25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Security for mite 3.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page