Decorator which can be applied to a function which profiles any calls to it. All calls to decorated callables must be done within the context of the profiler.
(self, name=None)
| 321 | self._put_result(name, diff, caller.filename, caller.lineno) |
| 322 | |
| 323 | def profile_callable(self, name=None): |
| 324 | """ |
| 325 | Decorator which can be applied to a function which profiles any calls to it. All calls to decorated |
| 326 | callables must be done within the context of the profiler. |
| 327 | """ |
| 328 | |
| 329 | def _outer(func): |
| 330 | _name = func.__name__ if name is None else name |
| 331 | return self.profile_ctx(_name)(func) |
| 332 | |
| 333 | return _outer |
| 334 | |
| 335 | def profile_iter(self, name, iterable): |
| 336 | """Wrapper around anything iterable to profile how long it takes to generate items.""" |
no outgoing calls