Context manager that times agent invocations.
(self, node_id: str)
| 429 | |
| 430 | @contextmanager |
| 431 | def agent_timer(self, node_id: str): |
| 432 | """Context manager that times agent invocations.""" |
| 433 | self.__init_timers__() |
| 434 | start_time = time.time() |
| 435 | try: |
| 436 | yield |
| 437 | finally: |
| 438 | end_time = time.time() |
| 439 | duration = (end_time - start_time) |
| 440 | self._timers[f"agent_{node_id}"] = duration |
| 441 | |
| 442 | @contextmanager |
| 443 | def human_timer(self, node_id: str): |
nothing calls this directly
no test coverage detected