erez-marmor
erez-marmor
inspecting with pdb shows that indeed there are multiple root frames: ```py (Pdb) set(frame_tuple[0][0] for frame_tuple in self.frame_records) {'ThreadPoolExecutor-1_0\x00\x00123145414610944', 'ThreadPoolExecutor-0_0\x00\x00123145414610944'} (Pdb) ``` this I assume is because of fastapi's thread...
@joerick , thanks for the speedy reply! ideally, I would expect the profiler instance to be created only once instead of per request (right now it's not a problem since...
> The profiler isn't heavy, as you say, but also it isn't intended to be reused (without a call to reset()). In fact, you can call start(), stop(), start(), stop()...
since it's a statistical profiler I think aggregating results has its merits: consider 2 endpoints using the same utility function ; in the call graph you'll see both branches and...
@joerick , it occurred to me that if I would make the changes you suggested to the middleware (or using `reset()`) and at the same time aggregate the session data...
@joerick , following your advice I changed the middleware to be: ```py class ProfilingMiddleware: """ middleware that profiles request """ def __init__(self, profiler_interval: float = 0.0001, ): self._profiler = Profiler(interval=profiler_interval)...