The average number of comments of PRs in the selected time range.
PR Review Depth (in Comments per RR) is related to the quality of code review, indicating how thorough your team reviews PRs.
This metric is calculated by counting the total number of PR comments divided by the total number of PRs in the selected time range.
Data Sources Required
This metric relies on PRs/MRs collected from GitHub, GitLab, BitBucket, Gitee or other code review tools.
Data Transformation Required
N/A
SQL Queries
If you want to measure the monthly trend of PR review time
in the screenshot below, please run the following SQL in Grafana.
SELECT DATE_ADD(date(pr.created_date), INTERVAL -$interval(date(pr.created_date))+1 DAY) as time, count(distinct prc.id)/count(pr.id) as "PR Review Depth" FROM pull_requests pr left join pull_request_comments prc on pr.id = prc.pull_request_id WHERE $__timeFilter(pr.created_date) and pr.base_repo_id in ($repo_id) and pr.merged_date is not null GROUP BY 1