Skip to content

An example of load testing a flask application with restplus and sqlalchemy using Locust.io

Notifications You must be signed in to change notification settings

rapphil/flask-restplus-sqlalchemy-locust-memory-leak

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A minimal example of a load test using Locust on Flask-SQLAlchemy + Flask-RESTPlus CRUD App.

Introduction

Locust is an open source load testing tool which allows you to define load testing scenarions under a locustfile.py file. Very handy to hook up python integration tests with load testing.

Flask SQLAlchemy simplifies the setup of the SQLAlchemy ORM into a Flask application.

Flask RESTPLus automatically adds swagger docs to your Flask REST api.

This project is a TODO CRUD from Flask RESTplus website using Flask SQLAlchemy to store the TODOs. It is then load tested with Locust.

Quick start

pip install -r requirements.txt  # Install dependencies
python init_db.py  # Creates the database.
python backend.py  # Starts the backend.
locust --host=http://localhost:5000  # Starts the locust backend.

Open http://127.0.0.1:5000 to check you TODO list REST API!

Open http://127.0.0.1:8089 and start your load test!

More

http://docs.locust.io/en/latest/quickstart.html

https://flask-restplus.readthedocs.io/en/stable/

http://flask-sqlalchemy.pocoo.org/2.1/

About

An example of load testing a flask application with restplus and sqlalchemy using Locust.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%