Metrics and Queries for Development
This lesson explains which development measures are useful, and which are misleading.
Learning outcomes
After completing this lesson, you will be able to:
- Identify useful pull request measures.
- Explain why activity counts mislead.
- Identify where development data can be found.
- Recommend actions from pull request data.
What to measure
Development metrics should describe the system that a developer works within, and not rate the individual. The most useful ones follow the path of a change through a pull request.
Pull request cycle time
Pull request cycle time runs from opening to merging, and it divides into time waiting for a first review, time in review and time waiting to merge. Long waits for a first review are the commonest cause of slow delivery, and they point to review capacity or to oversized changes.
Pull request size
Large pull requests take longer to review and receive less thorough attention. Tracking the distribution of pull request sizes encourages small batches, which is a core DevOps aim.
Merge frequency and branch age
Merge frequency shows how often work is integrated into main, and branch age shows how long work stays apart. An old branch signals a future difficult merge.
Code churn
Code churn measures how much recently written code is rewritten soon afterwards. High churn in one component may signal unclear requirements or an unstable design, although it is normal during early development.
The following diagram shows where the time goes in a team's pull requests, from opening to first review and from first review to merge.

Useful or misleading?
What not to measure
Lines of code and commit counts measure activity. A developer who deletes 2,000 lines of duplicated code has improved the system, yet appears to have negative output. Once a measure is used to judge individuals, people optimize the number and not the outcome, a pattern known as Goodhart's law. On the exam, an option that ranks developers by commits or lines of code is almost always a distractor.
Where the data comes from
In Azure DevOps, pull request data is available through the Azure Repos REST API, and through az repos pr list in the Azure CLI. Service hooks can record pull request events in a data store. The Analytics OData service provides work item, pipeline and test data, so pull request reporting usually involves the REST API.
In GitHub, the Insights tab of a repository shows contributors, commits, code frequency and pull request activity. Pulse summarizes activity for a chosen period. Pull request search qualifiers such as is:pr is:merged merged:>2026-10-01 support simple queries, and the GraphQL API supports full reporting. GitHub Copilot metrics are a separate area, and are not needed for this skill.
Finding pull request data
Slow reviews
Developers complain that delivery is slow. Data shows a median of 26 hours from opening a pull request to its first review, and a median of 3 hours from first review to merging. The median pull request changes 1,400 lines. Which two actions are most likely to help?
The first review wait is the largest delay, and the size of the changes is a likely contributor, since large pull requests are avoided by reviewers. The team should reduce pull request size by breaking work into smaller changes, and should use CODEOWNERS or automatically included reviewers so that the right people are asked immediately. Requiring more approvers would lengthen the wait, and measuring commits per developer would not address either cause.
Why is a count of lines of code a poor productivity measure?
Show answer
It measures activity, not value. Removing duplicated code improves a system, yet it would score negatively, and people would optimize the number.
Exam Tips
Remember for the exam
- Measure the system, not individual developers.
- Divide pull request time into wait, review and merge to find the delay.
- Lines of code and commit counts measure activity, not value.
- Azure Repos pull request data comes from the REST API or CLI.
- Small pull requests are reviewed more quickly and more carefully.