Skip to content

Add step_timeline: per-run step waterfall + bottleneck steps#413

Merged
JE-Chen merged 1 commit into
devfrom
feat/step-timeline-batch
Jun 24, 2026
Merged

Add step_timeline: per-run step waterfall + bottleneck steps#413
JE-Chen merged 1 commit into
devfrom
feat/step-timeline-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 24, 2026

Copy link
Copy Markdown
Member

Why

The action profiler aggregates timings by step name across many runs — great for "which action is slow on average", useless for "why was this run slow". A single run is an ordered timeline: step A ran, then B, then C, and one of them dominated. step_timeline turns one run's steps into a waterfall and ranks the bottleneck steps.

  • build_timeline — each step's offset / duration / pct share + total (wall-clock span), busy (summed step time), bottleneck, and parallelism (= busy/total; > 1 when steps overlap)
  • critical_steps — the top steps that dominate the run, longest first

Fourth and final HIGH item of the test-robustness lane.

Design

  • A step is any {name, duration, start?} dict. With explicit start times, overlapping/parallel steps land on an absolute timeline (parallelism surfaces); without, steps lay out back-to-back. Pure stdlib, radon-clean.
  • 5 layers wired: core → facade __all__AC_build_timeline / AC_critical_steps → read-only ac_* MCP tools → Script Builder (Testing). Qt-free verified; pytest.approx throughout (no float ==).

Tests

test/unit_test/headless/test_step_timeline_batch.py — sequential waterfall offsets + bottleneck, pct share, an overlapping run reporting parallelism 1.5, ranked critical_steps with pct + top, empty run, and the executor paths + 5-layer wiring. 35 passed across the whole test-robustness lane (failure_signature / run_diff / flake_cluster / step_timeline).

The action profiler aggregates timings by step name across runs, which
can't explain why one specific run was slow. Turn a single run's ordered
steps into a waterfall (each step's offset, duration and share of the
total) with the bottleneck step and a parallelism ratio, and rank the
dominant steps. A step is any {name, duration, start?} dict; explicit
start times place overlapping steps on an absolute timeline. Pure
stdlib.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 32 complexity · 0 duplication

Metric Results
Complexity 32
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit b25b747 into dev Jun 24, 2026
17 of 18 checks passed
@JE-Chen JE-Chen deleted the feat/step-timeline-batch branch June 24, 2026 18:10
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant