Skip to main content

Pull Request Metrics

Pull request metrics provide insights into the volume, size, productivity, and interactions of pull requests in your repositories. They read from five tables: pull_requests (one row per PR), pull_request_reviews, pull_request_comments, pull_request_commits and pull_request_events. To export the underlying rows, see Exporting Row-Level Data.

Available Metrics

Pull requests (pull_requests table)
count → pr_count
Number of pull requests
aggregation → {agg}_additions, {agg}_deletions, {agg}_total_changes
Size of pull requests (additions, deletions, and their sum)
aggregation → {agg}_output_estimate
Bilanc Output Estimate: a 0–100 complexity and effort score per PR, calibrated per repository. See the glossary
ratio → review_ratio
Share of PRs that received at least one review (0–1)
count → contributors_count
Number of distinct PR authors. Only available through get-multiple-metrics
aggregation → {agg}_pr_cost
Estimated cost of each PR from the author’s salary. Requires the salary permission
aggregation → {agg}_cost_per_productivity
50 × PR cost ÷ output estimate. Requires the salary permission
Reviews (pull_request_reviews table)
count → review_count
Number of distinct PRs that received a review
count → review_interactions_count
Number of reviews, excluding self-reviews
ratio → avg_review_rounds
Average review rounds per PR
ratio → reviewers_per_pr
Average distinct reviewers per PR. Only available through get-multiple-metrics
count → active_reviewers_count
Number of distinct reviewers in the period
ratio → changes_requested_rate
Share of reviews that requested changes. Only available through get-multiple-metrics
Comments (pull_request_comments table)
count → messages_count
Number of comments
count → message_interactions_count
Number of distinct PRs that received comments
ratio → comments_per_pr
Average comments per PR
Commits (pull_request_commits table)
count → commits_count
Number of commits
count → commit_interactions_count
Number of distinct PRs that received commits
Events (pull_request_events table)
count → pr_events_count
Number of PR lifecycle events (pr_opened, commit, review, comment, pr_merged, pr_closed). Filter with event_types

Pull Requests Count Metric

This endpoint provides the count of pull requests based on specified filters.

Pull Requests Size Metric

This endpoint provides information about the size of pull requests.

Output Estimate Metric

This endpoint provides the Bilanc Output Estimate of pull requests, a per-PR score of complexity and effort.

Parameter Notes

string
Must be a date column of the metric’s table:
  • pull_requests metrics: pr_created_at, pr_merged_at (default), pr_closed_at, first_commit_at, last_commit_at, first_review_at, first_comment_at, first_activity
  • pull_request_reviews metrics: reviewed_at (default), latest_reviewed_at, pr_created_at, pr_merged_at, pr_closed_at
  • pull_request_comments metrics: commented_at
  • pull_request_commits metrics: committed_at
  • pull_request_events metrics: event_at
string
Required for pull-requests-size, output-estimate, pull-requests-cost and productivity-cost. Accepted values: SUM, MAX, MIN, AVG. Count and ratio metrics do not take one.
string[]
Any column of the metric’s table, e.g. repository, pr_state, pr_category, source, branch_name, name (author), review_rounds_bucket, or the derived fields team_name, squad_name, manager_name, pr_author_team_name. The full column list per table is on the overview.
object
Applicable filters for pull request metrics:
  • repositories: Array of {"repository_name": "..."} objects
  • member: Filter by author merged user IDs
  • team: Filter by team IDs
  • squad_ids: Filter by squad IDs
  • squad_levels: Filter by squad hierarchy level
  • manager_ids: Filter by manager user IDs
  • departments: Filter by department names
  • pr_states: PR states — open, closed, merged
  • pr_categories: PR category classifications
  • pr_ids: Filter by specific PR IDs
  • sources: VCS source — github, gitlab, bitbucket
  • pull_requests_search_term: Full-text search across PR title, description, body, summary, and category
  • locations: Filter by employee location
  • levels: Filter by employee level
  • review_hour_of_day: Filter reviews by hour of day (0–23) — review metrics only
  • review_rounds_bucket: Filter by review rounds bucket — review metrics only
  • event_types: Filter events by type — pull-request-events-count only

Common Use Cases

  • Monitor PR Volume: Track the number of PRs created over time
  • Identify Large PRs: Find PRs that are above a certain size threshold using metric_min_value
  • Analyze Review Culture: Track review rate and comments per PR
  • Assess productivity Trends: Monitor if code productivity is increasing or decreasing over time
  • Team Comparison: Compare PR metrics across different teams or repositories