AIOload
https://blog.mogollon.com.ve/2020/01/10/load-testing-with-python/
Load test tool using aiosonic http client. For drawing charts we use matplotlib and pandas.
Usage of uvloop is highly recommended.
Requirements
python>=3.6
Installation
pip install aioload
# optional, highly recommended, doesn't work on Windows
pip install uvloop
Usage
you need to specify your request in a settings file like config.ini
[http]
sock_read = 30
sock_connect = 3
[test]
# target url for test
url = http://localhost:8080/api/v1/something
# methods: get, post, put, delete
method = post
#
# use body for send body in request
# if body is json, indicate correct header in headers section
# comment body line if you're doing a get request
body = '{"foo": "bar"}'
# query params if needed, this will transform url
# in something like http://localhost:8080/api/v1/something?token=something
[params]
token = something
# headers if needed
[headers]
content-type = application/json
usage example
> aioload -h
usage: aioload [-h] [-d] [-v] [-n NUMBER_OF_REQUESTS] [-c CONCURRENCY]
[--plot]
testfile
positional arguments:
testfile Test file to be executed
optional arguments:
-h, --help show this help message and exit
-d, --debug true if present
-v, --verbose true if present
-n NUMBER_OF_REQUESTS, --number_of_requests NUMBER_OF_REQUESTS
number of requests to be done, default: 100
-c CONCURRENCY, --concurrency CONCURRENCY
concurrency (requests at the same time), default: 10
--plot draw charts if present
> aioload config.ini -n 3000 -c 100 --plot -v
2019-05-29 17:20:51,662 - __init__:135 - info - 8cf56ded860f41d8a86dab2aed05218f - starting script... -
2019-05-29 17:20:55,301 - __init__:102 - info - 8cf56ded860f41d8a86dab2aed05218f - done - min=14.54ms; max=212.21ms; mean=109.36ms; req/s=600.0; req/q_std=333.7; stdev=24.65; codes.200=3000; concurrency=100; requests=3000;
You can override aioload runner methods, here is an example. Then you should execute the script you made, in this example: python sample/dynamic_test.py conf.ini -v
Note
Python has limits, if your applications is crazy fast like this crystal server, the test will be limited by aiosonic’s client speed.
Contribute
fork
create a branch feature/your_feature
commit - push - pull request
Dependencies are handled with pip-tools
thanks :)
Release files for aioload 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aioload-0.4.0.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aioload-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.2 kB
Release files / aioload-0.4.0.tar.gz
| Download URL | aioload-0.4.0.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
830f12d010dd8e103098fbc0d8caa77965c83fff35c8723045825b12ca059f19
|
|
BLAKE2b-256 checksum How to use checksums |
0363d276408882e7c550884434957cea9249b281fb7a574bb7011474b3c5f740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.25.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.7
|
Release files / aioload-0.4.0-py3-none-any.whl
| Download URL | aioload-0.4.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
83a2d155379644db7739589ee1bec446f027036c2711f6981881cdc76911ecb3
|
|
BLAKE2b-256 checksum How to use checksums |
a257dd9694cd3231e6b8689dd5fde025e090fb9bdefb8ea7cebb7a1a6f7c3f19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.25.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.7
|