发布

  • feat(core): show a performance report at the end of every run (#36077)

    frostbyte_neo 发布于 2026-06-25 21:15:16 +00:00

    Current Behavior

    After a run, Nx prints the cached-task summary but gives no insight into
    how the
    run's wall-clock time was spent or how to make it faster — no breakdown
    of the
    critical-path floor versus parallelism contention, and no actionable
    guidance.

    Expected Behavior

    Every run ends with a concise performance report:

    • Headline stats — run duration, cache result (hit rate, or Skipped (--skip-nx-cache)), critical path (the dependency floor: how long the
      run
      would take with unlimited slots), and recoverable time (wall-clock lost
      to slot
      contention — recoverable with a higher --parallel or more machines).
    • Targeted recommendations, one per lever and ordered
      cheapest-action-first:
      speed up/split the longest critical-path tasks (listed inline), raise
      --parallel, distribute with Nx Agents, enable remote cache, or drop
      --skip-nx-cache. Only the levers that actually apply to the run are
      shown.
    • A docs link — a clickable OSC 8 hyperlink where supported, a plain
      auto-linked URL in CI, carrying a utm=performance-report tag.
    • Where it renders — in the Terminal UI, inside the exit-countdown
      popup
      (pressing q mid-run still shows the original exit dialog); otherwise
      (non-TUI,
      or a single task) it's flushed to the terminal after the run summary.
      The report
      is delivered exactly once.

    Related Issue(s)

    N/A

    Notes

    • The analysis (PerformanceAnalysis) is a pure function of the
      timings the
      lifecycle collects
      — no coupling to the orchestrator/scheduler. It
      derives the
      occupancy timeline, the critical path, and the overhead split entirely
      from task
      start/end timestamps.
    • The report is built once at the end and delivered either through the
      native TUI
      exit popup or a terminal flush, deduped so it never prints twice.

    Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
    Co-authored-by: FrozenPandaz FrozenPandaz@users.noreply.github.com

    下载附件