Context manager that times model invocations.
(self, node_id: str)
| 417 | |
| 418 | @contextmanager |
| 419 | def model_timer(self, node_id: str): |
| 420 | """Context manager that times model invocations.""" |
| 421 | self.__init_timers__() |
| 422 | start_time = time.time() |
| 423 | try: |
| 424 | yield |
| 425 | finally: |
| 426 | end_time = time.time() |
| 427 | duration = (end_time - start_time) |
| 428 | self._timers[f"model_{node_id}"] = duration |
| 429 | |
| 430 | @contextmanager |
| 431 | def agent_timer(self, node_id: str): |
nothing calls this directly
no test coverage detected