Chromium CQ Status

Source code:
https://chromium.googlesource.com/infra/infra/+/master/appengine/chromium_cq_status/
Use "fetch infra" to clone the dev repos.



Site directory listing:

/recent
Example: /recent#project=chromium,action=patch_start
Shows a table of recently received records.
Tags to filter by are specified as a comma separated list after the #.


/v2/patch-status/<codereview_hostname>/<issue>/<patchset>
Example: /v2/patch-status/codereview.chromium.org/1067633003/1
Shows a log of CQ activity on a given patch.
Only accepts GET requests.


/v2/patch-summary/<codereview_hostname>/<issue>/<patchset>
Example: /v2/patch-summary/codereview.chromium.org/1067633003/1
API for getting a summary of the activity on a patch.
Only accepts GET requests.
Patch summary format (all duration values are in seconds):
{
  "success": bool,
  "begin": timestamp,
  "end": timestamp,
  "durations": <durations summary>,
  "job_counts": {
    "passed": int,
    "failed": int,
    "running": int
  },
  "flaky_jobs": [<job summary>],
  "attempt_count": int,
  "attempt_fail_count": int,
  "attempts": [{
    "success": bool,
    "fail_reason": json,
    "begin": timestamp,
    "end": timestamp,
    "durations": <durations summary>,
    "jobs": {
      "passed": [<job summary>],
      "failed": [<job summary>],
      "running": [<job summary>]
    }
  }]
}

Durations summary format:
{
  "running_all_jobs": float,
  "blocked_on_closed_tree": float,
  "blocked_on_throttled_tree": float,
  "committing": float,
  "total": float
}

Job summary format:
{
  "success": bool,
  "retry": bool,
  "begin": timestamp,
  "end": timestamp,
  "duration": float,
  "master": string,
  "builder": string,
  "slave": string,
  "buildnumber": int,
  "url": string
}


/stats/<project>/(15-minutely|hourly|daily|weekly)
Examples:
/stats/chromium/15-minutely
/stats/chromium/hourly
/stats/chromium/daily
/stats/chromium/weekly
/stats/blink/15-minutely
/stats/blink/hourly
/stats/blink/daily
/stats/blink/weekly

Recent CQ stats for a project aggregated by various time intervals.
Only accepts GET requests.
Accepts optional URL param for how many data points to fetch:
  data_points: int


/stats/query
Examples:
/stats/query?project=chromium&names=issue-count,patchset-*&count=3
/stats/query?key=6361816489787392&names=attempt-durations

API for querying CQ stats.
Only accepts GET requests.
Accepts the following optional URL params:
  key: int
  project: str
  interval_minutes: int
  begin: timestamp
  end: timestamp
  names: str // Comma separated globs where * and ? are permitted for fuzzy matching.
  count: int=100 // Max 1000.
  cursor: str=''

The returned query results are in the following JSON structure:
{
  "results": [
    {
      "key": int,
      "project": str,
      "interval_minutes": int,
      "begin": timestamp,
      "end": timestamp,
      "stats": [
        {
          "type": "count",
          "name": str,
          "description": str,
          "count": int
        }
        OR
        {
          "type": "list",
          "name": str,
          "description": str,
          "unit": str,
          "sample_size": int,
          "min": float,
          "max": float,
          "mean": float,
          "percentile_10": float,
          "percentile_25": float,
          "percentile_50": float,
          "percentile_75": float,
          "percentile_90": float,
          "percentile_95": float,
          "percentile_99": float
        }
      ]
    }
  ],
  "cursor": str,
  "more": bool
}


/stats/(highest|lowest)/<list stats name>/<CQ stats key>
Examples:
/stats/highest/attempt-durations/6361816489787392
/stats/lowest/attempt-durations/6361816489787392

API for querying highest/lowest data points in individual stats.
Only accepts GET requests.
Data points are returned in the following JSON structure:
[
  [
    float,
    {data point metadata}
  ]
]
The highest data points are given in descending order.
The lowest data points are given in ascending order.
Data point metadata is typically of the form:
{
  "issue": int,
  "patchset": int
}


/query
Examples:
/query/project=chromium/action=patch_start?count=10
/query?tags=project%3Dchromium,action%3Dpatch_start&count=10

API for querying CQ records.
Only accepts GET requests.
Accepts the following optional URL params:
  key: str (non numeric)
  begin: timestamp
  end: timestamp
  tags: str (comma separated)
  fields: json
  count: int=100 (max 1000)
  cursor: str

The returned query results are in the following JSON structure:
{
  "results": [{
    "timestamp": int,
    "key": str|null,
    "tags": [str],
    "fields": {field: value}
  }],
  "more": bool,
  "cursor": str
}

Tags may be specified directly in the URL e.g. /query/tag_a/tag_b.


/post
API for posting CQ records.
Requires @chromium.org/@google.com sign in.
Only accepts POST requests.
Accepts multiple p URL params.
Each p value is a record to add in the following JSON structure:
{
  "key": str|null,
  "tags": [str],
  "fields": {field: value}
}
"project" is a required key in "fields".



TESTING ONLY:
Query entries from /query: key: begin: end: tags: fields: count: cursor:
Query view:
Post entry to /post: key: tags: fields: Post result: