Calculate the percentage of CI builds that pass over a given time window.
Build success rate is the simple percentage of builds that passed out of all builds run, giving a snapshot reliability metric for a pipeline or team over a period. Mean Time Between Failures complements it with a time-based view — total elapsed time divided by the number of failures — which better reflects how often a team actually experiences a broken build in practice, since a low-frequency but high-volume pipeline can have the same success rate as a high-frequency one while producing failures at a very different real-world cadence.
Success rate
successRate = (successfulBuilds / totalBuilds) × 100
MTBF
MTBF = totalTime / failures
Success rate is volume-normalized and ignores build frequency, while MTBF is time-normalized and ignores how many builds ran — a pipeline running 10x more builds per day at the same success rate has a proportionally shorter MTBF, which is often the more actionable signal for on-call/interrupt burden.
Mature CI pipelines with good test isolation typically target 90%+ on main-branch builds; consistently lower rates often point to flaky tests, unstable infrastructure, or a broken-build culture where failures aren't fixed before more commits land.
For an honest reliability picture, track them separately if possible — infrastructure flakiness (agent crashes, network blips) and genuine code/test failures point to very different remediation, even though both count as 'failed builds' in a raw success rate.