Skip to content

Commit 14d543b

Browse files
authored
fix exec_time in summary because of parallel (#1171)
1 parent 697bf4a commit 14d543b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

rdagent/log/ui/utils.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -336,25 +336,25 @@ def get_summary_df(log_folders: list[str], hours: int | None = None) -> tuple[di
336336
else:
337337
v["script_time"] = None
338338

339-
exp_gen_time = timedelta()
340-
coding_time = timedelta()
341-
running_time = timedelta()
342-
all_time = timedelta()
343339
times_info = load_times_info(Path(lf) / k)
340+
341+
exp_gen_time = coding_time = running_time = timedelta()
342+
start_times, end_times = [], []
343+
344344
for loop_times in times_info.values():
345345
for step_name, step_time in loop_times.items():
346-
step_duration = step_time["end_time"] - step_time["start_time"]
346+
duration = step_time["end_time"] - step_time["start_time"]
347+
start_times.append(step_time["start_time"])
348+
end_times.append(step_time["end_time"])
349+
347350
if step_name == "exp_gen":
348-
exp_gen_time += step_duration
349-
all_time += step_duration
351+
exp_gen_time += duration
350352
elif step_name == "coding":
351-
coding_time += step_duration
352-
all_time += step_duration
353+
coding_time += duration
353354
elif step_name == "running":
354-
all_time += step_duration
355-
running_time += step_duration
356-
elif step_name in ["feedback", "record"]:
357-
all_time += step_duration
355+
running_time += duration
356+
357+
all_time = (max(end_times) - min(start_times)) if start_times else timedelta()
358358
v["exec_time"] = str(all_time).split(".")[0]
359359
v["exp_gen_time"] = str(exp_gen_time).split(".")[0]
360360
v["coding_time"] = str(coding_time).split(".")[0]

0 commit comments

Comments
 (0)