Statistics

Access merge queue and CI performance statistics.


Time to merge statistics for every queues and partitions

GET /repos/{owner}/{repository}/stats/time_to_merge

Get the average time to merge statistics, in seconds, for all the queues and partitions in the repository

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

at string <date-time>

Retrieve the time to merge at this timestamp (in seconds)

branch string

The name of the branch

200 Successful Response
partition_namestringrequired

The name of the partition, if no partition are used the partition name will be `__default__`

queuesTimeToMergePerQueue[]required

The time to merge data for each queue in the current partition

queue_namestringrequired

The name of the queue

time_to_mergeTimeToMergeResponserequired

The time to merge data for the partition's queue

meannumber | nullrequired
mediannumber | nullrequired
Example Response

                          [
  {
    "partition_name": "string",
    "queues": [
      {}
    ]
  }
]
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/time_to_merge" \
  -H "Authorization: Bearer <token>"

Get the queue checks outcome for the repository

GET /repos/{owner}/{repository}/stats/merge_queue_checks_outcome
Deprecated

Statuses describing the state in which the pull requests have left the queue(s).

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Merge queue name(s) of the pull requests

priority_rule_name string[]

Name of the priority rule(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
groupsChecksOutcomeGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
priority_rule_namestring | nullrequired
statsQueueChecksOutcomerequired
BASE_BRANCH_CHANGEDinteger

The pull request base branch has changed

BASE_BRANCH_MISSINGinteger

The base branch does not exist anymore

BATCH_MAX_FAILURE_RESOLUTION_ATTEMPTSinteger

The maximum batch failure resolution attempts has been reached

BRANCH_UPDATE_FAILEDinteger

The pull request can't be updated for security reasons

CHECKS_FAILEDinteger

The checks for the queued pull request have failed

CHECKS_TIMEOUTinteger

The checks for the queued pull request have timed out

CONFLICT_WITH_BASE_BRANCHinteger

The pull request conflicts with the base branch

CONFLICT_WITH_PULL_AHEADinteger

The pull request conflicts with at least one pull request ahead in queue

DRAFT_PULL_REQUEST_CHANGEDinteger

New commits have been added to the draft pull request that were not made by Mergify

INCOMPATIBILITY_WITH_BRANCH_PROTECTIONSinteger

The pull request cannot be checked because of an incompatibility with branch protections

MERGE_QUEUE_RESETinteger

The merge queue has been reset

PR_AHEAD_DEQUEUEDinteger

A pull request ahead in the queue has been dequeued

BATCH_AHEAD_FAILEDinteger

A pull request ahead in the queue failed to get merged

PR_CHECKS_STOPPED_BECAUSE_MERGE_QUEUE_PAUSEinteger

The checks have been interrupted because the merge queue is paused on this repository

PR_DEQUEUEDinteger

Pull request has been dequeued

PR_DEQUEUED_FROM_PARTITIONinteger

Pull request has been dequeued from a partition

PR_UNEXPECTEDLY_FAILED_TO_MERGEinteger

Pull request unexpectedly failed to get merged

PR_WITH_HIGHER_PRIORITY_QUEUEDinteger

A pull request with a higher priority has been queued

PULL_REQUEST_UPDATEDinteger

The pull request has been unexpectedly updated

QUEUE_RULE_MISSINGinteger

The queue rules are missing because of a configuration change

SPECULATIVE_CHECK_NUMBER_REDUCEDinteger

The number of speculative checks, in the queue rules, has been reduced

SUCCESSinteger

Successfully merged the pull request

PR_MANUALLY_MERGEDinteger

The pull request has been manually merged

DRAFT_PULL_REQUEST_CREATION_FAILEDinteger

The draft pull request cannot be created

DRAFT_PULL_REQUEST_CREATION_BRANCH_NOT_INDEXEDinteger

The draft pull request cannot be created because GitHub has not indexed the branch yet

CONFIGURATION_CHANGEDinteger

The configuration has changed

UNPROCESSABLE_PULL_REQUESTinteger

The pull request could not be processed by Mergify

PR_MANUALLY_DEQUEUEDinteger

The pull request has been manually dequeued by a dequeue command

INTERMEDIATE_RESULTS_SKIPPEDinteger

The pull request intermediate results have been skipped during batch promotion

CHECKS_RETRIEDinteger

The checks have failed and are being retried

SCHEDULED_FREEZE_STATUS_CHANGEDinteger

The batch has been split because a scheduled freeze changed the freeze status of its pull requests

Example Response

                          {
  "groups": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": {}
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/merge_queue_checks_outcome" \
  -H "Authorization: Bearer <token>"

Get the count of queue checks outcomes

GET /repos/{owner}/{repository}/stats/queues_checks_outcome_count

Statuses describing the state in which the pull requests have left the queue(s), grouped by time intervals.

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Merge queue name(s) of the pull requests

priority_rule_name string[]

Name of the priority rule(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
groupsChecksOutcomeByIntervalGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
priority_rule_namestring | nullrequired
statsCheckOutcomeInInterval[]required
startstring <date-time>required
endstring <date-time>required
check_outcomestringrequired
countintegerrequired
Example Response

                          {
  "groups": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/queues_checks_outcome_count" \
  -H "Authorization: Bearer <token>"

Get the count of pull requests entering the queues

GET /repos/{owner}/{repository}/stats/queues_entered_count

Queues pull requests entered by intervals of time

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Name of the merge queue(s) for the pull requests

priority_rule_name string[]

Name of the priority rule(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
groupsEnteredGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
priority_rule_namestring | nullrequired
statsEnteredInInterval[]required
startstring <date-time>required
endstring <date-time>required
enteredintegerrequired
Example Response

                          {
  "groups": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/queues_entered_count" \
  -H "Authorization: Bearer <token>"

Get the count of pull requests merged by queues

GET /repos/{owner}/{repository}/stats/queues_merged_count

Queues pull requests merged by intervals of time

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Name of the merge queue(s) for the pull requests

priority_rule_name string[]

Name of the priority rule(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
groupsMergedGroupResponse[]required
base_refstringrequired
partition_namesstring[]required
queue_namestringrequired
priority_rule_namestring | nullrequired
statsMergedInInterval[]required
startstring <date-time>required
endstring <date-time>required
mergedintegerrequired
Example Response

                          {
  "groups": [
    {
      "base_ref": "string",
      "partition_names": null,
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/queues_merged_count" \
  -H "Authorization: Bearer <token>"

Get the average CI runtime

GET /repos/{owner}/{repository}/stats/average_ci_runtime

Runtime of your CI running on queued pull requests by intervals of time

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Name of the merge queue(s) for the pull requests

priority_rule_name string[]

Name of the priority rule(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
groupsCIRuntimeGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
priority_rule_namestring | nullrequired
statsRuntimeInInterval[]required
startstring <date-time>required
endstring <date-time>required
runtimenumberrequired
Example Response

                          {
  "groups": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/average_ci_runtime" \
  -H "Authorization: Bearer <token>"

Get the average idle queue time

GET /repos/{owner}/{repository}/stats/average_queue_time

Idle time spent in queue by the Pull Requests by intervals of time

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Name of the merge queue(s) for the pull requests

priority_rule_name string[]

Name of the priority rule(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
groupsmergify_engine__web__api__statistics__average_queue_time__QueueTimeGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
priority_rule_namestring | nullrequired
statsmergify_engine__web__api__statistics__average_queue_time__QueueTimeInInterval[]required
startstring <date-time>required
endstring <date-time>required
queue_timenumberrequired
Example Response

                          {
  "groups": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/average_queue_time" \
  -H "Authorization: Bearer <token>"

Get the queue time

GET /repos/{owner}/{repository}/stats/total_queue_time

Total time spent in queue by the Pull Requests by intervals of time

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Name of the merge queue(s) for the pull requests

priority_rule_name string[]

Name of the priority rule(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
groupsmergify_engine__web__api__statistics__total_queue_time__QueueTimeGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
priority_rule_namestring | nullrequired
statsmergify_engine__web__api__statistics__total_queue_time__QueueTimeInInterval[]required
startstring <date-time>required
endstring <date-time>required
avg_queue_timenumberrequired
max_queue_timenumberrequired
min_queue_timenumberrequired
Example Response

                          {
  "groups": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/total_queue_time" \
  -H "Authorization: Bearer <token>"

Get the queue size

GET /repos/{owner}/{repository}/stats/queue_size

Get the average, max and min queue size over the period by intervals of time

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Name of the merge queue(s) for the pull requests

priority_rule_name string[]

Name of the priority rule(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
groupsQueueSizeGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
priority_rule_namestring | nullrequired
statsQueueSizeInInterval[]required
startstring <date-time>required
endstring <date-time>required
avg_sizenumberrequired
max_sizeintegerrequired
min_sizeintegerrequired
Example Response

                          {
  "groups": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/queue_size" \
  -H "Authorization: Bearer <token>"

Get the number of running speculative checks

GET /repos/{owner}/{repository}/stats/running_speculative_checks

Speculative checks running on queues by intervals of time

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Merge queue name(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
groupsRunningChecksGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
statsRunningChecksInInterval[]required
startstring <date-time>required
endstring <date-time>required
avg_running_checksnumberrequired
max_running_checksintegerrequired
min_running_checksintegerrequired
Example Response

                          {
  "groups": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "stats": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/running_speculative_checks" \
  -H "Authorization: Bearer <token>"

Get the checks batch size

GET /repos/{owner}/{repository}/stats/batch_size

Batch size of the checks running on queues by intervals of time

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Merge queue rule name(s) of the pull requests

priority_rule_name string[]

Name of the priority rule(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
groupsBatchSizeGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
priority_rule_namestring | nullrequired
statsBatchSizeInInterval[]required
startstring <date-time>required
endstring <date-time>required
avg_batch_sizenumberrequired
max_batch_sizeintegerrequired
min_batch_sizeintegerrequired
Example Response

                          {
  "groups": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/batch_size" \
  -H "Authorization: Bearer <token>"

Get batch bisection statistics

GET /repos/{owner}/{repository}/stats/batch_bisection

Statistics about bisection events in the merge queue

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Merge queue rule name(s) of the pull requests

priority_rule_name string[]

Name of the priority rule(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
startedBisectionStartGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
priority_rule_namestring | nullrequired
statsBisectionStartInInterval[]required
startstring <date-time>required
endstring <date-time>required
bisection_countintegerrequired
avg_depthnumberrequired
max_depthintegerrequired
avg_batch_size_before_splitnumberrequired
completedBisectionEndGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
priority_rule_namestring | nullrequired
statsBisectionEndInInterval[]required
startstring <date-time>required
endstring <date-time>required
bisection_completed_countintegerrequired
culprit_found_countintegerrequired
max_failure_reached_countintegerrequired
Example Response

                          {
  "started": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": null
    }
  ],
  "completed": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/batch_bisection" \
  -H "Authorization: Bearer <token>"

Get the queue failure rate

GET /repos/{owner}/{repository}/stats/failure_rate

Failure rate of pull requests in the merge queue by intervals of time

Application Key GitHub Token
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repository string required

The name of the repository

min length: 1 · pattern: ^[\w\-\.]+$

base_ref string[]

Base reference(s) of the pull requests

partition_name string[]

Partition name(s) of the pull requests

queue_name string[]

Name of the merge queue(s) for the pull requests

priority_rule_name string[]

Name of the priority rule(s) of the pull requests

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
groupsFailureRateGroupResponse[]required
base_refstringrequired
partition_namestringrequired
queue_namestringrequired
priority_rule_namestring | nullrequired
statsFailureRateInInterval[]required
startstring <date-time>required
endstring <date-time>required
totalintegerrequired
failuresintegerrequired
failure_ratenumberrequired
Example Response

                          {
  "groups": [
    {
      "base_ref": "string",
      "partition_name": "string",
      "queue_name": "string",
      "priority_rule_name": "string",
      "stats": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/failure_rate" \
  -H "Authorization: Bearer <token>"

Was this page helpful?