metrics
default

Measure the amount of code that was pushed outside of pull requests.

post/metrics/code_bypassing_prs

Request

Request body

accountinteger required

Session account ID.

date_fromstring date required

Commits must be made later than or equal to this date.

date_tostring date required

Commits must be made earlier than or equal to this date.

timezoneinteger

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

inRepositoryID[] required

Set of repositories. An empty list raises a bad response 400. Duplicates are automatically ignored.

with_authorDeveloperID[]

A set of developers. An empty list disables the filter and includes everybody. Duplicates are automatically ignored.

with_committerDeveloperID[]

A set of developers. An empty list disables the filter and includes everybody. Duplicates are automatically ignored.

granularitystring required

How often the metrics are reported. The value must satisfy the following regular expression: /^all|(([1-9]\d* )?(aligned )?(day|week|month|year))$/. "all" produces a single interval [date_from, date_to]. "aligned week/month/year" produces intervals cut by calendar week/month/year borders, for example, when date_from is 2020-01-15 and date_to is 2020-03-10, the intervals will be 2020-01-15 - 2020-02-01 - 2020-03-01 - 2020-03-10.

only_default_branchboolean

Consider only commits that are accessible from the head of the default branch. For example, if your workflow includes PR-ing feature branches, you rebase and merge them and don't delete afterward, bypassing_prs will report the commits in those feature branches unless you set only_default_branch to true.

Example request

{
  "account": 1,
  "date_from": "2020-01-01",
  "date_to": "2020-03-01",
  "granularity": "day",
  "in": [
    "{1}",
    "github.com/athenianco/athenian-webapp"
  ],
  "with_author": [
    "github.com/vmarkovtsev"
  ]
}

Response

Calculated metrics.

datestring date required

Commits were pushed beginning with this date. They were not pushed later than +granularity.

bypassed_commitsinteger required

Number of commits that bypassed PRs in the time interval.

bypassed_linesinteger required

Number of changed (added + removed) lines that bypassed PRs in the time interval.

total_commitsinteger required

Overall number of commits in the time interval.

total_linesinteger required

Overall number of changed (added + removed) lines in the time interval.

Example response

[
  {
    "date": "2020-01-23",
    "bypassed_commits": 1,
    "bypassed_lines": 20,
    "total_commits": 2,
    "total_lines": 50
  },
  {
    "date": "2020-01-24",
    "bypassed_commits": 2,
    "bypassed_lines": 30,
    "total_commits": 3,
    "total_lines": 60
  }
]

Changes

No recorded changes to this operation across all 90 revisions of this API.