Lead Time for Changes
Lead Time for Changes is the time from a code commit to that code running in production, and it is a DORA metric for delivery speed.
Understanding Lead Time for Changes
What Is Lead Time for Changes
Lead Time for Changes measures how long a change takes to travel from the first commit to running successfully in production. It covers everything in between: code review wait, pipeline run, approval gates, and the rollout itself. Because it includes human waiting time, it often reveals bottlenecks that pipeline speed alone does not.
In many organisations the two orange steps, review wait and approval wait, dominate the total, and the pipeline is a small fraction.
Benchmarks
DORA reports vary a little by year. A commonly cited set:
| Tier | Lead time |
|---|---|
| Elite | Less than one day (one hour in some older reports) |
| High | One day to one week |
| Medium | One week to one month |
| Low | One month to six months |
Measuring It
Take the difference between the first commit timestamp and the production deploy completion timestamp for each change, then use the median across a rolling window. The mean is skewed by rare very large changes.
from datetime import datetimefrom statistics import median FMT = "%Y-%m-%dT%H:%M:%SZ" def lead_time_hours(commit_ts, deploy_ts): delta = datetime.strptime(deploy_ts, FMT) - datetime.strptime(commit_ts, FMT) return delta.total_seconds() / 3600 lead_times = [lead_time_hours(c, d) for c, d in pairs] # pairs fetched from your APIprint(f"Median lead time: {median(lead_times):.2f} hours")How to Reduce It
- Smaller pull requests: easier to review and merge within hours.
- Review SLAs and clear ownership: often the cheapest big win.
- Split test suites: a fast unit suite gates every merge, slower end-to-end tests run less often.
- Fewer stacked approvals: one production gate is reasonable, three from three teams rarely is.
- Continuous deployment: replace weekly release trains with deploy-on-merge.
Troubleshooting
| Symptom | Check | What to Look For |
|---|---|---|
| Unrealistically short | Start timestamp used | Measuring from merge, not first commit |
| Huge variance | Median vs mean | A few long-lived PRs skewing the average |
| No gain from faster pipeline | Per-phase breakdown | Review or approval wait dominating |
TipIf you fix only one bottleneck, fix review wait time. It is usually the largest and cheapest to improve.
RememberLead time and Deployment Frequency are related but different. A fast pipeline with batched releases still has a low frequency.
SecurityVery short lead times with advisory scans can mean security checks are skipped. Keep SAST and dependency scans blocking as you optimise.
Common MistakeMeasuring only from PR merge to deploy. That hides review wait, the biggest bottleneck in most teams.
Frequently Asked Questions
Why measure lead time from commit rather than from ticket creation?
Commit-to-production isolates delivery capability (review, build, test, approval) from upstream planning and prioritisation delays that reflect business process rather than engineering.
Does a faster pipeline always reduce lead time?
Not necessarily. If changes sit in long-lived branches or wait days for review, pipeline speed is a small part of the total. Trunk-based development with small commits usually helps more.
Should I use the average or the median?
Use the median, optionally alongside the 90th percentile. A few unusually large changes can distort the mean and hide what a typical change experiences.