Skip to content

Commit 92dc7a1

Browse files
committed
feat: サブモジュールとアクションの再開時間をログに記録する機能を追加
1 parent c37cf9f commit 92dc7a1

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/adf_core_python/core/component/module/abstract_module.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ def precompute(self, precompute_data: PrecomputeData) -> AbstractModule:
5959
def resume(self, precompute_data: PrecomputeData) -> AbstractModule:
6060
self._count_resume += 1
6161
for sub_module in self._sub_modules:
62+
start_time = time.time()
6263
sub_module.resume(precompute_data)
64+
self._logger.debug(
65+
f"{self.__class__.__name__}'s sub_module {sub_module.__class__.__name__} resume time: {time.time() - start_time:.3f}",
66+
)
6367
return self
6468

6569
def prepare(self) -> AbstractModule:

src/adf_core_python/core/component/tactics/tactics_agent.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,17 @@ def module_precompute(self, precompute_data: PrecomputeData) -> None:
124124

125125
def module_resume(self, precompute_data: PrecomputeData) -> None:
126126
for module in self._modules:
127+
start_time = time.time()
127128
module.resume(precompute_data)
129+
self._logger.debug(
130+
f"module {module.__class__.__name__} resume time: {time.time() - start_time:.3f}",
131+
)
128132
for action in self._actions:
133+
start_time = time.time()
129134
action.resume(precompute_data)
135+
self._logger.debug(
136+
f"action {action.__class__.__name__} resume time: {time.time() - start_time:.3f}",
137+
)
130138
for executor in self._command_executor:
131139
executor.resume(precompute_data)
132140

0 commit comments

Comments
 (0)