Files
intelligent-daily-report-sy…/plugin/profiler/profiler.py
2026-02-25 15:22:23 +08:00

16 lines
445 B
Python

from fastapi import FastAPI
from fastapi_profiler import Profiler as FastapiProfilerMiddleware
from plugin.base import Plugin
class Profiler(Plugin):
def __init__(self, app: FastAPI, dashboard_path: str = "/profiler"):
self.app = app
self.dashboard_path = dashboard_path
self.name = "Profiler"
self.version = "1.0.0"
def install(self):
FastapiProfilerMiddleware(self.app, self.dashboard_path)