sunhailin-Leo / fastapi_profiler

A FastAPI Middleware of https://github.com/joerick/pyinstrument to check your service performance.
MIT License
231 stars 13 forks source link

Output to json speedscope #15

Closed Joel-eGarcia closed 7 months ago

Joel-eGarcia commented 10 months ago

json output format can be supported, just html and prof are available.

something like this:


app.add_middleware(
    PyInstrumentProfilerMiddleware,
    profiler_output_type="json",
    prof_file_name="example_profile.json"
)`
sunhailin-Leo commented 9 months ago

@Joel-eGarcia

sunhailin-Leo commented 7 months ago

@Joel-eGarcia

HCharlie commented 6 months ago

I am uploading the json file generated by the json example to https://www.speedscope.app/, it shows below, any idea how to fix this?

Screenshot 2024-04-27 at 21 44 15