engineering_analytics
engineering_analytics

How long a selected workflow, matrix, job or step usually takes: compares it with runs of the same workflow on the repository's default branch over the last 7 days, from stored data only. A run counts only when it ran the same jobs on the same runner tiers, so the answer never mixes in a different workflow, job or runner. Pull request runs and merge queue runs are left out. At most the newest 40 default-branch runs are checked, and sampled is true when more existed. average_seconds and sample_count cover successful samples only, and recent lists the newest three matches of any status. average_seconds is null when no comparable run exists. unavailable_reason says why no comparison was made. Answers are cached for 5 minutes.

get/api/projects/{project_id}/engineering_analytics/ci_timing_context/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/engineering_analytics/ci_timing_context/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

ci_engine'github_actions' | 'depot_ci' required

CI engine that ran the run.

  • github_actions - GitHub Actions
  • depot_ci - Depot CI
job_idsstring

Comma-separated job ids from workflow_jobs, at most 200. Required for 'matrix', 'job' and 'step'. Give exactly one id for 'job' and 'step'. Ignored for 'workflow'.

kind'workflow' | 'matrix' | 'job' | 'step' required

What to compare: the whole 'workflow', a 'matrix' (several jobs of the run), one 'job', or one 'step' of a job.

  • workflow - Workflow
  • matrix - Matrix
  • job - Job
  • step - Step
repostring required

'owner/name' repository the run belongs to.

run_attemptinteger required

Run attempt that holds the selection.

run_idinteger required

Integer run id of the run that holds the selection.

source_idstring uuid

Connected GitHub data warehouse source to read from. Defaults to the source connected for repo.

step_numberinteger

Number of the step within the job. Required when kind is 'step'.

Response

default_branchstring nullable required

The repository's default branch, which the samples ran on. Null when unknown.

window_daysinteger required

How many days back the comparison looks.

identity'workflow_id' | 'workflow_name' required
  • workflow_id - Workflow id
  • workflow_name - Workflow name
runs_scannedinteger required

How many default-branch runs of the workflow were checked for a match.

sampledboolean required

True when the window held more eligible runs than were checked, so the figures cover the newest runs only.

sample_countinteger required

How many checked runs matched the selection and succeeded.

average_secondsnumber double nullable required

Mean duration of the successful samples, in seconds. Null when there are none. A run counts only when it ran the same jobs on the same runners, so a null means no comparable run.

runs_synced_atstring date-time nullable required

When the last completed sync of the stored workflow runs started. Null when unknown.

jobs_synced_atstring date-time nullable required

When the last completed sync of the stored workflow jobs started. Null when unknown.

Changes

No recorded changes to this operation across all 1 revision of this API.