Context manager that times thinking stages.
(self, node_id: str, stage: str)
| 465 | |
| 466 | @contextmanager |
| 467 | def thinking_timer(self, node_id: str, stage: str): |
| 468 | """Context manager that times thinking stages.""" |
| 469 | self.__init_timers__() |
| 470 | start_time = time.time() |
| 471 | try: |
| 472 | yield |
| 473 | finally: |
| 474 | end_time = time.time() |
| 475 | duration = (end_time - start_time) |
| 476 | self._timers[f"thinking_{node_id}_{stage}"] = duration |
| 477 | |
| 478 | @contextmanager |
| 479 | def memory_timer(self, node_id: str, operation_type: str, stage: str): |
no test coverage detected