A plug-and-play performance monitoring tool for FastAPI with a real-time dashboard.
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
FastAPI Performance Monitor
A simple, plug-and-play performance monitoring tool for FastAPI applications, providing real-time metrics and a dashboard with zero configuration.
╔═════════════════════════════════════════════════════════════════════════════╗
║ FastAPI Performance Dashboard ║
╠════════════════════════════════╦════════════════════════════════════════════╣
║ SLA Compliance ║ Overall Metrics ║
║ Latency SLA Met: true ║ Total Requests: 1,245 ║
║ Availability SLA Met: true ║ Success Count: 1,230 (98.8%) ║
║ ║ Error Count: 15 (1.2%) ║
╠════════════════════════════════╩════════════════════════════════════════════╣
║ Endpoint Metrics (GET /items/{item_id}) ║
╠════════════════════════════════╦════════════════════════════════════════════╣
║ Total Requests: 834 ║ P50 Response Time: 52 ms ║
║ Success Count: 830 ║ P90 Response Time: 110 ms ║
║ Error Count: 4 ║ P95 Response Time: 154 ms ║
║ ║ P99 Response Time: 230 ms ║
╚════════════════════════════════╩════════════════════════════════════════════╝
Features
- Zero Configuration: Add a single line of code to your app to get started.
- Real-time Metrics: Tracks total requests, success/error counts, and error rates.
- Latency Percentiles: Calculates P50, P90, P95, and P99 response times to give you a clear picture of your application's responsiveness.
- SLA Monitoring: Automatically determines if your application is meeting its latency and availability service-level agreements (SLAs).
- Interactive Dashboard: A clean, real-time dashboard to visualize all performance metrics.
- Lightweight: Designed to have a minimal performance impact on your application.
Installation
pip install fastapi-performance-monitor
Quick Start
In your main application file, import add_performance_monitor and apply it to your FastAPI app instance.
# main.py
from fastapi import FastAPI
from fastapi_performance_monitor import add_performance_monitor
import time
import random
app = FastAPI()
# Add this single line to enable the monitor
add_performance_monitor(app)
@app.get("/")
def read_root():
# Simulate some work
time.sleep(random.uniform(0.05, 0.5))
return {"message": "Hello World"}
@app.get("/error")
def cause_error():
raise ValueError("This is a test error")
Once your application is running, the following endpoints will be available:
- Performance Dashboard:
http://localhost:8000/performance - Metrics API Endpoint:
http://localhost:8000/health/metrics
The dashboard provides a user-friendly interface to view the metrics, while the JSON endpoint allows for programmatic access, perfect for integrating with alerting or other monitoring systems.
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 fastapi_performance_monitor-0.1.2.tar.gz.
File metadata
- Download URL: fastapi_performance_monitor-0.1.2.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddaa01655c466e5e0a5c8ef6e4dd8bb075ccf17be7d710d74289ed948880ec00
|
|
| MD5 |
7ab2167af4e52914c60e92d531c6f799
|
|
| BLAKE2b-256 |
6628f39223c07d5145db054a0700e3b8b6ef711b00f18ca223f4edb76992f696
|
Provenance
The following attestation bundles were made for fastapi_performance_monitor-0.1.2.tar.gz:
Publisher:
publish.yml on parhamdavari/fastapi-performance-monitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastapi_performance_monitor-0.1.2.tar.gz -
Subject digest:
ddaa01655c466e5e0a5c8ef6e4dd8bb075ccf17be7d710d74289ed948880ec00 - Sigstore transparency entry: 314862015
- Sigstore integration time:
-
Permalink:
parhamdavari/fastapi-performance-monitor@d102d3e26cb1962aa16ddd0b1ae06393e6cdcb4d -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/parhamdavari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d102d3e26cb1962aa16ddd0b1ae06393e6cdcb4d -
Trigger Event:
release
-
Statement type:
File details
Details for the file fastapi_performance_monitor-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fastapi_performance_monitor-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c4065ee3255258c56ab3afb6df28fda7c68f03e44c8d3d4cbe200b466b05fc5
|
|
| MD5 |
258f19663da09f8249eb685352de6e12
|
|
| BLAKE2b-256 |
b0b783f0a3bda19c9f151751720ca0663d05bbd9e6973a6b0631512256aa6fc2
|
Provenance
The following attestation bundles were made for fastapi_performance_monitor-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on parhamdavari/fastapi-performance-monitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastapi_performance_monitor-0.1.2-py3-none-any.whl -
Subject digest:
4c4065ee3255258c56ab3afb6df28fda7c68f03e44c8d3d4cbe200b466b05fc5 - Sigstore transparency entry: 314862018
- Sigstore integration time:
-
Permalink:
parhamdavari/fastapi-performance-monitor@d102d3e26cb1962aa16ddd0b1ae06393e6cdcb4d -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/parhamdavari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d102d3e26cb1962aa16ddd0b1ae06393e6cdcb4d -
Trigger Event:
release
-
Statement type: