File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff 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 = []
You can’t perform that action at this time.
0 commit comments