A flask extension to log route latency
Project description
A flask extension to log route latency
Example
from flask import Flask
from flask_crlatency import RouteLatencyLogger
app = Flask(__name__)
app.config["SECRET_KEY"] ="your_secret_key"
app.config["DEBUG"] = True
app.config["MAX_ROUTE_LATENCY"] = 0.1
latency_logger = RouteLatencyLogger(app)
@app.route("/")
def index():
return "Hello, World!"
if __name__ == "__main__":
app.run()
response:
[2023-08-19 10:00:58,654] WARNING in __init__: High latency for route index: 3.001345 seconds
127.0.0.1 - - [19/Aug/2023 10:00:58] "GET / HTTP/1.1" 200 -
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
flask-crlatency-0.0.2.tar.gz
(2.7 kB
view details)
Built Distribution
File details
Details for the file flask-crlatency-0.0.2.tar.gz
.
File metadata
- Download URL: flask-crlatency-0.0.2.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0f71af7a26d7da9ae12dfbcc5e8b9248ca0a8250432a22a94f53b02e122dea7 |
|
MD5 | 1403135b455e88f937d01a2e79496b4d |
|
BLAKE2b-256 | 13d232002828132fc69aff11781216a1c37532c84c4c88ce0bcef8d130401e33 |
File details
Details for the file flask_crlatency-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: flask_crlatency-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df8b793247317654a4dfb3ea8d7334f18f551f62acf41ab0b76f5ec4dfb4664f |
|
MD5 | 1cc7559e0551617989f22e52d52f8f42 |
|
BLAKE2b-256 | 40072bbda4461069a85a2f57d301d7639599c86e427fb97e3cb31a4feea9ce79 |