curl load test and response comparison dashboard
Project description
Curl Compare Load Test
A lightweight Flask-based load testing dashboard that executes real curl commands against two target hosts and compares response behavior under concurrent traffic.
It is useful for migration validation, canary checks, regression detection, and performance baselining between API environments.
What It Does
- Runs the same
curltemplate against two hosts by replacing{host}. - Supports per-request variable substitution (
{id},{name}, etc.). - Simulates Locust-style concurrency with configurable users, spawn rate, and duration.
- Streams live results via Server-Sent Events (SSE).
- Compares responses as JSON (semantic compare) when possible, otherwise raw text.
- Captures
curltimings usingtime_totalandtime_starttransfer(TTFB). - Shows request-level diffs and aggregate metrics (avg, p50, p95, p99).
Requirements
- Python
>=3.9 curlavailable in the runtime environment- Pip for dependency installation
Installation
Install as a package:
pip install .
Or install dependencies only:
pip install -r requirements.txt
Running the Application
Development:
curl-compare-loadtest
Production example with Gunicorn:
gunicorn -w 4 -k gthread -b 0.0.0.0:8000 app:app
Open http://localhost:8000.
Quick Start
- Enter a
curltemplate that includes{host}. - Provide
Host 1andHost 2(domain only, no protocol). - Add variable lines (
key=value,key2=value2), one line per request profile. - Configure users, spawn rate, and duration.
- Run the test and inspect live status, latency metrics, and response diffs.
Curl Template and Variables
Required token
{host}must exist in the template.
Optional tokens
- Any
{token}that matches keys in each variable line. {vars}is also supported and maps to the full raw variable line.
Example:
Template:
curl -X GET "https://{host}/v1/items?id={id}&name={name}"
Variable lines:
id=123,name=alice
id=124,name=bob
Headers and body placeholders are also supported:
curl -X POST "https://{host}/v1/users" -H "X-Trace-Id: {trace_id}" -d '{"name":"{name}"}'
Comparison Logic
MATCH: responses are identical.- If both bodies are valid JSON, objects are compared structurally.
- Otherwise, raw response text is compared.
DIFFERENCE: responses differ.EMPTY: one or both responses are empty.TEMPLATE ERROR: template/render/command/timing issue occurred for at least one host.
Runtime Limits and Input Guardrails
users:1to500spawn_rate:0.1to200users/secduration_seconds:1to3600- per
curlexecution timeout:30seconds - stored response body for diff display: up to
20000chars per host
Out-of-range numeric values are clamped to safe limits.
API Endpoints
GET /
Serves the dashboard UI.GET /stream
Starts a run and streams events via SSE.POST /stop?run_id=<id>
Stops an active run.
/stream query parameters:
curl_templatehost1host2variables(multilinekey=value,...)usersspawn_rateduration_secondsrun_id(optional; generated if omitted)
Packaging
Build distributable artifacts:
python -m build
Artifacts are created in dist/ (wheel and source distribution).
Project Metadata
- Package:
curl-compare-loadtest - Entry point:
curl-compare-loadtest->app:main - License: MIT
Notes for Reliable Results
- Keep request templates deterministic where possible.
- Avoid including volatile fields (timestamps, random IDs) if strict matching is required.
- Use representative variable sets to simulate production-like traffic patterns.
License
MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file curl_compare_loadtest-0.0.4.tar.gz.
File metadata
- Download URL: curl_compare_loadtest-0.0.4.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61e9ec75c90c644e55e0f1777d39031511106bc8bcda2be70ae064f010dd4bfa
|
|
| MD5 |
41e380ffa64521fa43535444c40b72e2
|
|
| BLAKE2b-256 |
218c3b196bb7278c8a4af253972d2b78b318d75f1219a3030174216825a7441b
|
Provenance
The following attestation bundles were made for curl_compare_loadtest-0.0.4.tar.gz:
Publisher:
python-publish.yml on clay-36/curl-compare-loadtest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
curl_compare_loadtest-0.0.4.tar.gz -
Subject digest:
61e9ec75c90c644e55e0f1777d39031511106bc8bcda2be70ae064f010dd4bfa - Sigstore transparency entry: 1031915015
- Sigstore integration time:
-
Permalink:
clay-36/curl-compare-loadtest@af2ba649c0840029673278d0bb02f55df7356010 -
Branch / Tag:
refs/tags/0.0.4 - Owner: https://github.com/clay-36
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@af2ba649c0840029673278d0bb02f55df7356010 -
Trigger Event:
release
-
Statement type:
File details
Details for the file curl_compare_loadtest-0.0.4-py3-none-any.whl.
File metadata
- Download URL: curl_compare_loadtest-0.0.4-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa3d0b098a3cbfaac5019a50bea66090087b216a81a0c7c9a796eb135c489309
|
|
| MD5 |
686f93f77169d867229c88eded947b5e
|
|
| BLAKE2b-256 |
c2116644145b20868fd0cc9cc769b25dfeef378242485da7d782cb56bbc08fea
|
Provenance
The following attestation bundles were made for curl_compare_loadtest-0.0.4-py3-none-any.whl:
Publisher:
python-publish.yml on clay-36/curl-compare-loadtest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
curl_compare_loadtest-0.0.4-py3-none-any.whl -
Subject digest:
fa3d0b098a3cbfaac5019a50bea66090087b216a81a0c7c9a796eb135c489309 - Sigstore transparency entry: 1031915067
- Sigstore integration time:
-
Permalink:
clay-36/curl-compare-loadtest@af2ba649c0840029673278d0bb02f55df7356010 -
Branch / Tag:
refs/tags/0.0.4 - Owner: https://github.com/clay-36
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@af2ba649c0840029673278d0bb02f55df7356010 -
Trigger Event:
release
-
Statement type: