Metadata-Version: 2.1
Name: aioload
Version: 0.3.0
Summary: Load test tool
Home-page: https://github.com/sonic182/aioload
Author: Johanderson Mogollon
Author-email: johanderson@mogollon.com.ve
License: MIT
Keywords: testing loadtest load
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Dist: aiosonic (==0.1.0)
Requires-Dist: cycler (==0.10.0)
Requires-Dist: kiwisolver (==1.1.0)
Requires-Dist: matplotlib (<=3.1.1)
Requires-Dist: numpy (==1.17.0)
Requires-Dist: pandas (==0.25.0)
Requires-Dist: pyparsing (==2.4.2)
Requires-Dist: python-dateutil (==2.8.0)
Requires-Dist: pytz (==2019.2)
Requires-Dist: six (==1.12.0)
Requires-Dist: setuptools (==41.0.1)
Provides-Extra: test
Requires-Dist: aiohttp (==3.5.4) ; extra == 'test'
Requires-Dist: async-timeout (==3.0.1) ; extra == 'test'
Requires-Dist: atomicwrites (==1.3.0) ; extra == 'test'
Requires-Dist: attrs (==19.1.0) ; extra == 'test'
Requires-Dist: certifi (==2019.6.16) ; extra == 'test'
Requires-Dist: chardet (==3.0.4) ; extra == 'test'
Requires-Dist: coverage (==4.5.3) ; extra == 'test'
Requires-Dist: coveralls (==1.8.2) ; extra == 'test'
Requires-Dist: docopt (==0.6.2) ; extra == 'test'
Requires-Dist: entrypoints (==0.3) ; extra == 'test'
Requires-Dist: flake8 (==3.7.8) ; extra == 'test'
Requires-Dist: idna (==2.8) ; extra == 'test'
Requires-Dist: importlib-metadata (==0.18) ; extra == 'test'
Requires-Dist: mccabe (==0.6.1) ; extra == 'test'
Requires-Dist: more-itertools (==7.1.0) ; extra == 'test'
Requires-Dist: multidict (==4.5.2) ; extra == 'test'
Requires-Dist: packaging (==19.0) ; extra == 'test'
Requires-Dist: pluggy (==0.12.0) ; extra == 'test'
Requires-Dist: py (==1.8.0) ; extra == 'test'
Requires-Dist: pycodestyle (==2.5.0) ; extra == 'test'
Requires-Dist: pyflakes (==2.1.1) ; extra == 'test'
Requires-Dist: pyparsing (==2.4.0) ; extra == 'test'
Requires-Dist: pytest-aiohttp (==0.3.0) ; extra == 'test'
Requires-Dist: pytest-asyncio (==0.10.0) ; extra == 'test'
Requires-Dist: pytest-cov (==2.7.1) ; extra == 'test'
Requires-Dist: pytest-flake8 (==1.0.4) ; extra == 'test'
Requires-Dist: pytest-mock (==1.10.4) ; extra == 'test'
Requires-Dist: pytest (==5.0.1) ; extra == 'test'
Requires-Dist: requests (==2.22.0) ; extra == 'test'
Requires-Dist: six (==1.12.0) ; extra == 'test'
Requires-Dist: urllib3 (==1.25.3) ; extra == 'test'
Requires-Dist: uvloop (==0.12.2) ; extra == 'test'
Requires-Dist: wcwidth (==0.1.7) ; extra == 'test'
Requires-Dist: yarl (==1.3.0) ; extra == 'test'
Requires-Dist: zipp (==0.5.2) ; extra == 'test'

|build status| |coverage status| |pypi package|

AIOload
=======

Load test tool using aiosonic_ http client. for drawing charts we
use matplotlib and pandas.

Usage of uvloop is highly recommended, it gave me between 20% and 25% of increased speed.

Requirements
============

-  python>=3.6

Installation
============

.. code:: bash

  pip install aioload
  # optional, highly recommended
  pip install uvloop

Usage
=====

you need to specify your request in a settings file like **config.ini**

.. code:: 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

.. code:: bash

   > 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;

.. figure:: ./charts.jpg


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
==========

1. fork
2. create a branch ``feature/your_feature``
3. commit - push - pull request

Dependencies are handled with pip-tools_

thanks :)

.. _this: ./sample/server.cr
.. _aiosonic: https://github.com/sonic182/aiosonic
.. _here: https://github.com/sonic182/aioload/blob/master/sample/dynamic_test.py
.. _pip-tools: https://github.com/jazzband/pip-tools
.. |build status| image:: https://travis-ci.org/sonic182/aioload.svg?branch=master
   :target: https://travis-ci.org/sonic182/aioload
.. |coverage status| image:: https://coveralls.io/repos/github/sonic182/aioload/badge.svg?branch=master
   :target: https://coveralls.io/github/sonic182/aioload?branch=master
.. |pypi package| image:: https://badge.fury.io/py/aioload.svg
    :target: https://badge.fury.io/py/aioload

