Initial commit
This commit is contained in:
3
plugin/profiler/__init__.py
Normal file
3
plugin/profiler/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .profiler import Profiler
|
||||
|
||||
__all__ = ["Profiler"]
|
||||
15
plugin/profiler/profiler.py
Normal file
15
plugin/profiler/profiler.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user