Skip to main content

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 -

Metadata

Release files for flask-crlatency 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-crlatency 0.0.2
File Size Uploaded
flask-crlatency-0.0.2.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flask-crlatency 0.0.2
File Interpreter ABI Platform
flask_crlatency-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 5.7 kB

Release files / flask-crlatency-0.0.2.tar.gz

Download URL flask-crlatency-0.0.2.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d0f71af7a26d7da9ae12dfbcc5e8b9248ca0a8250432a22a94f53b02e122dea7
BLAKE2b-256 checksum
How to use checksums
13d232002828132fc69aff11781216a1c37532c84c4c88ce0bcef8d130401e33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / flask_crlatency-0.0.2-py3-none-any.whl

Download URL flask_crlatency-0.0.2-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df8b793247317654a4dfb3ea8d7334f18f551f62acf41ab0b76f5ec4dfb4664f
BLAKE2b-256 checksum
How to use checksums
40072bbda4461069a85a2f57d301d7639599c86e427fb97e3cb31a4feea9ce79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page