Skip to content

Commit 95b9a3f

Browse files
Update scripts/parse_log_and_summarize.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 45db696 commit 95b9a3f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/parse_log_and_summarize.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,14 @@ def analyze_step_time_breakdown(log_file_path):
172172
# 2. Calculate Dynamic Threshold
173173
# This threshold represents the minimum expected time interval between
174174
# the timestamps of two consecutive steps.
175+
THRESHOLD_BUFFER_SECONDS = 2.0
176+
DEFAULT_THRESHOLD_SECONDS = 20.0
175177
train_times = [e["train_time"] for e in events if e["type"] == "step"]
176178
if train_times:
177-
threshold = min(train_times) - 2.0
179+
# Ensure threshold is not negative, which would disable the correction logic.
180+
threshold = max(0, min(train_times) - THRESHOLD_BUFFER_SECONDS)
178181
else:
179-
threshold = 20.0
182+
threshold = DEFAULT_THRESHOLD_SECONDS
180183

181184
results = []
182185
processed_steps = []

0 commit comments

Comments
 (0)