histograms
default

Calculate histograms on continuous integration runs, such as GitHub Actions, Jenkins, Circle, etc.

Changed on
post/histograms/code_checks

Request

Request body

date_fromstring date required

Date from when to start measuring the distribution.

date_tostring date required

Date until which to measure the distribution.

timezoneinteger

Local time zone offset in minutes, used to adjust date_from and date_to.

quantilesnumber[]

Cut the distributions at certain quantiles. The default values are [0, 1] which means no cutting.

split_by_check_runsboolean

Calculate histograms separately for each number of check runs in suite.

accountinteger required

Session account ID.

Example request

{
  "for": [
    {
      "repositories": [
        "github.com/athenianco/athenian-webapp",
        "github.com/athenianco/athenian-api"
      ],
      "pushers": [
        "github.com/vmarkovtsev",
        "github.com/dpordomingo"
      ]
    }
  ],
  "histograms": [
    {
      "scale": "log",
      "metric": "chk-suite-time"
    }
  ],
  "account": 1,
  "date_to": "2020-11-23",
  "date_from": "2020-01-23",
  "timezone": 120
}

Response

Calculated histograms.

metric'chk-suites-count' | 'chk-suites-in-prs-count' | 'chk-successful-suites-count' | 'chk-failed-suites-count' | 'chk-cancelled-suites-count' | 'chk-success-ratio' | 'chk-suite-time' | 'chk-robust-suite-time' | 'chk-suites-per-pr' | 'chk-suite-time-per-pr' | 'chk-prs-with-checks-count' | 'chk-flaky-commit-checks-count' | 'chk-prs-merged-with-failed-checks-count' | 'chk-prs-merged-with-failed-checks-ratio' | 'chk-concurrency-max' | 'chk-concurrency' | 'chk-elapsed-time-per-concurrency' | 'chk-suite-occupancy' | 'chk-suite-critical-occupancy' | 'chk-suite-imbalance' required

The mentioned terms such as "check suite" and "check run" belong to the official documentation on GitHub.

  • chk-suites-count - number of executed check suites.
  • chk-suites-in-prs-count - number of executed check suites in pull requests.
  • chk-successful-suites-count - number of successfully executed check suites.
  • chk-failed-suites-count - number of failed check suites.
  • chk-cancelled-suites-count - number of cancelled check suites.
  • chk-success-ratio - chk-successful-suites-count divided by chk-suites-count.
  • chk-suite-time - average check suite execution time.
  • chk-robust-suite-time - average check suite execution time, alternative algorithm. We consider each suite size group separately, fill missing daily values by averaging the neighbors, and then take the average of group averages.
  • chk-suites-per-pr - average number of times check suites executed in a pull request.
  • chk-suite-time-per-pr - average check suite execution time by pull request. The difference with chk-suite-time is that we don't consider checks triggered by direct pushes, e.g. by merge commits.
  • chk-prs-with-checks-count - number of PRs that triggered at least one check suite.
  • chk-flaky-commit-checks-count - number of check suites triggered by the same commit but having different outcomes - both successful and failed.
  • chk-prs-merged-with-failed-checks-count - how many PRs were merged despite failing checks.
  • chk-prs-merged-with-failed-checks-ratio - ratio of PRs merged with failing checks to all merged PRs with checks.
  • chk-concurrency-max - maximum number of check runs of the same type executing in parallel. We consider check runs executing in parallel if their time intervals overlap ≥ 50%.
  • chk-concurrency - average number of check runs of the same type executing in parallel; we choose the check run type that corresponds to the maximum concurrency for each day. We consider check runs executing in parallel if their time intervals overlap ≥ 50%.
  • chk-elapsed-time-per-concurrency - cumulative time spent on each concurrency level across check runs. Only allowed for histograms.
  • chk-suite-occupancy - average ratio between summed time of check runs in a check suite and the product of the number of check runs with the maximum check run time in that check suite. 1 means ideal resource utilization, down to 0 for absolute inefficiency. For example, there are one slow check run that executes in 10x seconds, and N fast check runs that execute in x seconds, in the same check suite. The metric value will be (10x + Nx) / (10*(N+1)*x) → 0.1 if N → +∞.
  • chk-suite-critical-occupancy - chk-suite-occupancy calculated for critical check runs only. A critical check run is a check run of type that at least once dominated the check suite execution time on the time interval. This is the measure of check suite "trebble" when there are several slowest check runs that elapse time with some standard deviation.
  • chk-suite-imbalance - average difference between the time of the slowest and the second slowest check runs in a check suite. High values signal unbalanced jobs and CI/CD inefficiency.
scale'linear' | 'log' required

X axis scale: linear or logarithmic.

frequenciesinteger[] required

Series of histogram bar heights aka Y axis.

Example response

[
  {
    "for": {
      "repositories": [
        "github.com/athenianco/athenian-webapp",
        "github.com/athenianco/athenian-api"
      ]
    },
    "metric": "chk-suites-per-pr",
    "scale": "linear",
    "ticks": [
      0,
      1,
      2,
      3,
      5,
      8,
      12
    ],
    "frequencies": [
      0,
      38,
      28,
      13,
      120,
      100
    ],
    "interquartile": {
      "left": 2,
      "right": 8
    }
  }
]

Changes

    • info

      added the new optional request property ///////

    • info

      added the optional property /////// to the response with the status