DevStats Guides / Reading your metrics

Median vs. Average: How Should You Use Them for Engineering Metrics?

A few slow PRs can shift your team's cycle time average. Compare it with the median to decide what to examine.

Five fictional PR durations: 2, 3, 4, 5, and 31 hours. Every value contributes to the 9-hour average. The middle value gives a median of 4 hours.FIVE PULL REQUESTSILLUSTRATIVE DATA / HOURS2h 3h 4h 5h 31h AVERAGE 9 hSUM ÷ COUNTMEDIAN 4 hSORT → MIDDLE
01

So what's the difference?

If you work with engineering metrics, you probably see averages all the time: average review time, average pull request cycle time, average throughput…

But the average does not always show what is really happening in your process.

A cartoon in a bar. The bartender announces that, with Bill Gates walking in, everyone is a billionaire on average. A customer asks to see his billion. The caption reads, mean is not the same as typical.

One or two cases far outside the usual range can pull the number up or down and completely change how you interpret it.

The median, also known as the 50th percentile (P50), helps with exactly this. It shows the value in the middle of the distribution and often better represents the normal behavior of a process.

A cartoon comparing median and average. A customer in the middle of the group represents the median, while Bill Gates with a bag of money illustrates how an extreme value changes the average.

This does not mean the average is a bad metric. It considers every value, including the extremes (outliers), and that may be exactly what you need in certain situations.

The problem arises when we use the average to answer questions it cannot answer well. Understanding when to look at the average and when to look at the median can change both how you interpret the numbers and the decisions you make based on them.

See how a single value can influence the average

Fictional PR cycle times / hours
Each pull request
  1. PR A20h
  2. PR B24h
  3. PR C24hP50
  4. PR D28h
  5. PR E24h
Average24h
Median24h
How skewness changes the averageAverage 24h. Median 24h. Illustrative curve of skewness. The values are calculated from the five PRs.MedianAverage

Symmetric

Illustrative curve of skewness. The values are calculated from the five PRs.

How do we calculate them?
Add them up, divide by five

(20 + 24 + 24 + 28 + 24) ÷ 5 = 24h

Sort them, find the middle
  1. 20h
  2. 24h
  3. 24h
  4. 24h
  5. 28h

The middle value stays at 24h in this group, even when PR E becomes the shortest or the longest.

The average does not always reflect how the majority behaves.

02

Understand the scenarios

Same data, different readings. See how each measure can change the interpretation and the decision. These examples are illustrative, and the decisions show what a single reading might suggest. Durations use elapsed days, with 7 days per week.

Scenario 01

Is our code review process slow?

Review Time
1d, 2d, 2d, 3d, 1w

Average

3d

Across all PRs, Review Time was 3 days. The review that took a week had a substantial effect on that result.

Possible decision

Understand why specific PRs take much longer than others.

Median

More useful for this question

2d

A typical PR goes through review in approximately 2 days.

Possible decision

Check whether the typical 2 days meet the team’s needs before changing the whole process.

Scenario 02

How much work should we plan for the next sprint?

Throughput per sprint of 2 weeks
18, 19, 20, 23, 100 issues
Exceptional sprint
A migration split into many small issues resulted in 100 completions.

Average

36 issues

One sprint pulls the average up to 36 issues, even though the other four ranged from 18 to 23.

Possible decision

Plan 36 issues and assume the migration’s exceptional volume can be repeated next sprint.

Median

More useful for this question

20 issues

Typical throughput is closer to 20 issues per sprint of two weeks.

Possible decision

Use approximately 20 issues as a starting point and check whether the next sprint contains similarly sized work.

Scenario 03

How does our Cycle Time compare with the benchmark?

Our PR Cycle Time
1d, 2d, 2d, 3d, 2w
Hypothetical benchmark
3d average per PR
Comparable scope
Same metric definition, included stages, measurement period, and similar work.

Average

More useful for this question

4.4d

Our average exceeds the benchmark’s 3d. The PR that took 2w contributes to that result.

Possible decision

Use the gap to examine the longest waits and test changes that reduce average Cycle Time.

Median

2d

A typical PR takes 2d. Comparing that with the benchmark’s 3d average would make us appear faster, but mixes different measures.

Possible decision

Use 2d to track typical flow. Use our average when comparing with this benchmark.

Match the measure reported by the benchmark. If it reports a median, compare medians instead.

Scenario 04

Did our process change improve Cycle Time?

Use both
Before
1w, 2w, 2w, 3w, 12w
After
4d, 1w, 1w, 10d, 12w

Average

4w → 3.2w

Across all items, the average fell from 4 to 3.2 weeks. The case that took 12 weeks still weighs on the result.

Possible decision

Conclude that the change had little impact.

Median

2w → 1w

Cycle Time fell from 2 weeks to 1 week for typical work.

Possible decision

Recognize that flow improved for most deliveries.

The median shows improvement in typical flow, while the average shows that very slow cases still need a closer look.

Scenario 05

Which team has the healthier review process?

Use both
Squad A
1d, 1d, 2d, 2d, 2w
Squad B
3d, 3d, 3d, 4d, 4d

Average

A 4d · B 3.4d

By average, Squad B appears faster.

Possible decision

Examine review time in Squad A, which has a higher average.

Median

A 2d · B 3d

A typical PR completes review sooner in Squad A.

Possible decision

Examine Squad A’s practices to understand its faster typical review.

Do not turn this into a team ranking. Squad A has faster typical flow but a problematic tail, while Squad B is more consistent.

Flow metrics help examine processes, not create rankings between teams.

03

Compare them in DevStats

1. Compare average and median

  • In PR Cycle Time, start with the average to see the result across all PRs.

Opening DevStats Controls, selecting Average, and saving to update PR Cycle Time.

  • Switch to the median to see the time for a typical PR. Compare the two using the same team, period, and filters.

Switching from Average to Median (50th Percentile) in DevStats Controls and saving to compare PR Cycle Time with the same filters.

2. Identify unusual PRs (outliers)

  • Look for PRs that took much longer than the rest. They can help explain the gap between average and median.

Selecting Scatter in the PR Cycle Time report and hovering over a PR with a longer cycle time.

3. Investigate PRs with the longest cycle times

  • Examine one of those PRs to see which stages accounted for the most time.

Opening a PR in DevStats to examine its cycle time stages and delivery details.

This helps you identify whether the delays are isolated cases or part of a pattern that needs attention.

To learn more: see the Controls documentation and the PR Cycle Time definition.

Controls preferences carry across supported metrics. When you finish, select the measure you want to keep using.