For these kind of things one could use
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
The problem with statistical profilers is that they might fail to catch every single call, especially when they are fast.