Skip to main content

CloadTester 🚀

CloadTester (cloadtester) is a high-performance Python API load testing library backed by a native C++ multithreaded engine.

Unlike pure Python threading libraries which are constrained by the Global Interpreter Lock (GIL), CloadTester executes concurrent HTTP/HTTPS requests on true native OS C++ threads (std::thread), unlocking true parallel multi-core performance.


Key Features

  • True Parallel Multithreading: C++ releases the Python GIL during load test execution.
  • High Accuracy & Microsecond Precision: High-resolution timer metrics (std::chrono).
  • Zero Third-Party Binary Dependencies: Uses native platform APIs (WinHTTP on Windows, POSIX Sockets on Linux/macOS).
  • Rich Latency Analytics: Calculates Min, Mean, Max, P50, P90, P95, and P99 percentiles along with Requests Per Second (RPS).
  • Python API & CLI Tool: Use as a standard Python module or via the command-line interface cload-test.

Installation

Install directly from PyPI (once published):

pip install cloadtester

Or install locally for development:

pip install -e .

Quick Start Guide

1. Using Python API

from cloadtester import LoadTester
from cloadtester.reporter import print_summary

# Configure your API load test
tester = LoadTester(
    url="https://httpbin.org/post",
    method="POST",
    headers={"Authorization": "Bearer sample_token"},
    json_payload={"user_id": 101, "action": "benchmark"},
    timeout_ms=5000
)

# Run with 10 threads, performing a total of 100 requests
result = tester.run(num_threads=10, total_requests=100)

# Print formatted summary report
print_summary(result)

# Access programmatically
print(f"RPS: {result.requests_per_sec:.2f}")
print(f"P95 Latency: {result.percentile(95):.2f} ms")

2. Using Command-Line Tool (cload-test)

# Simple GET request load test
cload-test https://httpbin.org/get -t 10 -n 100

# POST request with JSON payload and custom headers
cload-test https://httpbin.org/post -m POST -t 20 -n 200 -d '{"key": "value"}' -H "Content-Type: application/json"

How to Publish to PyPI

Follow these steps to publish cloadtester to PyPI:

Step 1: Install Publishing Dependencies

pip install build twine

Step 2: Build Source Distribution and Binary Wheel

python -m build

This generates dist/cloadtester-0.1.0.tar.gz and dist/cloadtester-0.1.0-*.whl.

Step 3: Check Build Distribution

twine check dist/*

Step 4: Upload to PyPI

To upload to TestPyPI first:

twine upload --repository testpypi dist/*

To upload to production PyPI:

twine upload dist/*

License

MIT License. Free for commercial and open-source use.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloadtester-0.1.1.tar.gz (13.4 kB view details)

Uploaded Source

File details

Details for the file cloadtester-0.1.1.tar.gz.

File metadata

  • Download URL: cloadtester-0.1.1.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for cloadtester-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f686bc71b3856567c087973d4b85ecc3c8dd3eba93723dc69701f14411c6b68c
MD5 c48cd2cb02a27e3690c700fb0d84c342
BLAKE2b-256 5bb1e1dabec567cf9a9f9e5ef6a61411f709ef59bc2f7d2e2f6d8211392bd2a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page