Skip to content

feat(report): measure how long each job waits for a runner - #16

Merged
Nain9Dev merged 1 commit into
mainfrom
feat/ci-queue-time
Oct 15, 2026
Merged

Nain9Dev merged 1 commit into
mainfrom
feat/ci-queue-time

Conversation

@Nain9Dev

Copy link
Copy Markdown
Member

Summary

ci_report.py measured only the wait of a run's first job. A job that needs another one is created
when its dependency ends, so the queue that builds up later in a run was invisible.

  • Github.job_timings reads the jobs of a run from the REST API, which carries created_at (when the
    job became ready) next to started_at; gh run view does not.
  • For the sampled runs, a new section "Queue time per job" gives the median, p90 and maximum wait, the
    job that waits longest and the runners online, so a high figure can be read against capacity.
  • Skipped jobs and jobs that never started are not counted; a negative wait from clock skew is zero.
  • The table row of the report is unchanged.

Verification

  • tests/test_ci_report.py: 9 new tests (waits, percentile, section, real command, unreadable run);
    146 tests pass together; ruff format --check clean.
  • Run against a real repository of the organisation over three days: 218 jobs sampled, median wait
    12 s, p90 10 min, 28 % of the jobs waited more than five minutes, mostly at the busy hours.

Notes

  • One extra API call per sampled run (30 by default).

The report only had the wait for a run's first job, which hides the
queue that builds up later in a run: a job that needs another one is
created when its dependency ends, and on 15/10/2026 a seal job waited
13 minutes for a runner after everything else had finished. Read the
jobs from the REST API (created_at to started_at) for the sampled runs
and add a section with the median, p90 and maximum wait, the job that
waits longest, and the runners online.
@Nain9Dev
Nain9Dev merged commit 3bfb957 into main Oct 15, 2026
5 checks passed
@Nain9Dev
Nain9Dev deleted the feat/ci-queue-time branch October 15, 2026 10:56
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