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

Implement .prof output #13

Closed msnidal closed 1 year ago

msnidal commented 1 year ago

Nice profiler! I used it on a project and got some good usage out of it, as #9 raised though there is a lot of Python tooling out there to support .prof files such as snakeviz, etc. so I thought I'd add support for cProfile.

In addition to the new code I added an example and test for it - although the test is rudimentary (it just checks whether the .prof file exists and is non-empty) I had success on my machine getting the .prof output and loading it into snakeviz! Thanks again for the profiler.

sunhailin-Leo commented 1 year ago

LGTM~