2 ms·
Also, this kind of profiler is great because you can use it on any running Python program, which is pretty magical and very useful. (especially when it's an app
by jvns 6y ago
Also, this kind of profiler is great because you can use it on any running Python program, which is pretty magical and very useful. (especially when it's an application you didn't write)
But it's not right for every use case: by design austin/py-spy can only really profile the whole program, and if you want to profile a specific function or endpoint in your program, something like PyInstrument https://github.com/joerick/pyinstrument https://github.com/joerick/pyinstrument (which includes Django middlewares & Flask decorators) is a lot more useful.
- p403n1x87 6y agoFor these kind of things one could use https://github.com/P403n1x87/austin-python https://github.com/P403n1x87/austin-python An early attempt at an APM that was specifically designed to measure endpoint response times was here https://github.com/P403n1x87/austin/blob/apm/austin/apm.py https://github.com/P403n1x87/austin/blob/apm/austin/apm.py The problem with statistical profilers is that they might fail to catch every single call, especially when they are fast.