Code Monkey home page Code Monkey logo

hybrismart-asyncio-loadgenerator's Introduction

about

Exposes a simple class based component to create a series of request based on a seed file

dependencies

At the core we're using Python 3, and the libraries required for the script to work are:

  • aiohttp - asynchronous http calls
  • asyncio - event loop and async / await function support

If you have pip installed, you could install all dependencies by:

# install the dependencies

python3 -m pip install --user aiohttp
python3 -m pip install --user asyncio
python3 -m pip install --user matplotlib

how to use it

If you just want to use it as a CLI, you have the following parameters available:

  • inputfile - Indicates the file with all the URLs to hit
  • lfrom - The start line number from the file (default to 0)
  • lto - The the line number from the file (default to 9)
  • wait - The time to wait in between the batches
  • size - The requests to be sent per batch

manually configuring a test

Make sure you have a seed file that contains all the HTTP (get) requests to be made to stress the server

Then use the class HTTPLoadGenerator to configure the test, for example:

# configure the test
# set the requests per second (rps) to 10
# set the time to wait in between batches to 10 seconds
test = HTTPLoadGenerator(seed_file='/full/path/to/your/file',
  spare_time=10,
  rps=10
)

# start the test
test.start()

If you want to save the requests into a file, you can just:

test.save_results_to_file(filename='test-1.output')

This will save the file with a CSV style with the following information:

  • request start - the time on which the request started (from the event loop)
  • request id - the id of the request (in this case, followed sequentially)
  • elapsed time - time that took for the request to finish
  • response status - the HTTP response status retrieved for the given request

hybrismart-asyncio-loadgenerator's People

Contributors

carlos-mtz-arenas avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.