Track slow Flask routes and monitor bottlenecks
Project description
# 🐢 Slowpoke
Slowpoke is a lightweight Python package that helps you monitor and log slow API routes in your Flask application. If you're wondering "Which endpoints are dragging me down?", Slowpoke has your back.
🚀 Installation
Until we publish on PyPI, install directly from GitHub:
pip install git+https://github.com/vedangit/slowpoke.git
⚙️ Usage
1. Add slowpoke to your Flask app
from flask import Flask
from slowpoke import SlowpokeLogger
app = Flask(__name__)
slowpoke_logger = SlowpokeLogger(app, threshold_ms=1000)
The
threshold_msparameter sets the time (in milliseconds) after which a request is considered slow.
2. Run your app normally
Make requests as usual. Slowpoke will track how long each endpoint takes.
3. View the report
Once you've made some requests, generate a report from the command line:
slowpoke report
This will print a table of all routes that exceeded the threshold, including method, endpoint, duration, and timestamp.
🧪 Example App
You can test out slowpoke quickly by running the example Flask app:
cd examples
python app.py
Then hit some routes and run:
slowpoke report
🛣️ Roadmap
✅ Version 0 (Current):
- Log all Flask routes that exceed a threshold.
- CLI tool to view slow route report.
🔜 Version 1 (Coming soon):
- Middleware-based integration.
- Save reports to file.
- Optional integration with logging tools.
- FastAPI + Django support.
🧠 Why Slowpoke?
- 🚀 Fast to integrate
- 🔍 Focused on performance bottlenecks
- 🧼 Clean CLI reporting
- 💻 Perfect for side projects or production
👩💻 Author
Made with ❤️ by Vedangi
📄 License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slowpoke_flask-0.1.0.tar.gz.
File metadata
- Download URL: slowpoke_flask-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ad68321ce642ee5f1f4e50a0d4eb1315a4ed6130e0c8c4c813288df0a68743c
|
|
| MD5 |
ecec5ac5bc7aba122886116537a0cc1c
|
|
| BLAKE2b-256 |
9250c1e2460bfd6acc9ba099d4120508d0372edee76c5fa55882156af1728734
|
File details
Details for the file slowpoke_flask-0.1.0-py3-none-any.whl.
File metadata
- Download URL: slowpoke_flask-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
483c97d40d5f9c786d460321cc9b8d5894458ed2594d7d6ae7c08845f1f7f1a5
|
|
| MD5 |
68bf091767a144e2c49f6b42854f5abf
|
|
| BLAKE2b-256 |
079f88a0663b9cd6b459ff16b84e58a8989fce5e3edcffb535306fdd08f5b586
|