Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

chunli

Project description

chunli

chunli

Distributed load test application


Documentation: https://dutradda.github.io/chunli

Source Code: https://github.com/dutradda/chunli


Key Features

  • Distributed load test application
  • Receive file with urls
  • Receive file with json lines
  • Receive python scripts *

* feature in development.

Requirements

  • Python 3.8+

Instalation

$ pip install chunli

Basic Example

Running the server (needs uvicorn installed):

uvicorn chunli:app

Create chunli's input file (needs gzip installed):

echo http://localhost:8001/hello | gzip > /tmp/hello-call.gz

zcat /tmp/hello-call.gz

Start chunli's job (needs curl installed):

curl -X POST \
    -i 'localhost:8000/run?duration=3&rps_per_node=1' \
    --upload-file /tmp/hello-call.gz
HTTP/1.1 100 Continue

HTTP/1.1 201 Created
date: Thu, 1st January 1970 00:00:00 GMT
server: uvicorn
content-type: application/json
content-length: 110

{"task_id":"4ee301eb-6487-48a0-b6ed-e5f576accfc2","start_time":"1970-01-01T00:00:00+00:00","status":"running"}

Gets chunli's job results:

sleep 5 && \
    curl -i 'localhost:8000/run?task_id=4ee301eb-6487-48a0-b6ed-e5f576accfc2'
HTTP/1.0 200 OK
date: Thu, 1st January 1970 00:00:00 GMT
server: uvicorn
content-type: application/json
content-length: 409

{"end_time":"1970-01-01T00:00:00+00:00","result":{"duration":1.0,"requested_rps_per_node":1.0,"realized_requests":1.0,"realized_rps":1.0,"latency":{"mean":1.0,"median":1.0,"percentile99":1.0,"percentile95":1.0},"error":null,"nodes_quantity":1,"errors_count":0},"task_id":"4ee301eb-6487-48a0-b6ed-e5f576accfc2","start_time":"1970-01-01T00:00:00+00:00","status":"finished"}

Json Lines Example

Running the server:

uvicorn chunli:app

Create chunli's input file:

echo '{"url":"http://localhost:8001/hello"}
{"url":"http://localhost:8001/hello","method":"GET"}' \
    | gzip > /tmp/hello-call.gz

zcat /tmp/hello-call.gz

Start chunli's job:

curl -X POST \
    -i 'localhost:8000/run?duration=1&rps_per_node=10' \
    --upload-file /tmp/hello-call.gz
HTTP/1.1 100 Continue

HTTP/1.1 201 Created
date: Thu, 1st January 1970 00:00:00 GMT
server: uvicorn
content-type: application/json
content-length: 110

{"task_id":"4ee301eb-6487-48a0-b6ed-e5f576accfc2","start_time":"1970-01-01T00:00:00+00:00","status":"running"}

Gets chunli's job results:

sleep 2 && \
    curl -i 'localhost:8000/run?task_id=4ee301eb-6487-48a0-b6ed-e5f576accfc2'
HTTP/1.0 200 OK
date: Thu, 1st January 1970 00:00:00 GMT
server: uvicorn
content-type: application/json
content-length: 409

{"end_time":"1970-01-01T00:00:00+00:00","result":{"duration":1.0,"requested_rps_per_node":1.0,"realized_requests":1.0,"realized_rps":1.0,"latency":{"mean":1.0,"median":1.0,"percentile99":1.0,"percentile95":1.0},"error":null,"nodes_quantity":1,"errors_count":0},"task_id":"4ee301eb-6487-48a0-b6ed-e5f576accfc2","start_time":"1970-01-01T00:00:00+00:00","status":"finished"}

Project details


Download files

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

Files for chunli, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size chunli-0.5.0-py3-none-any.whl (14.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size chunli-0.5.0.tar.gz (142.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page