The Cup of Coffee Metric for Continuous Integration
Years ago, while standing at the coffee machine waiting for a build, I realised something simple: the time it takes to drink a cup of coffee is a pretty good proxy for how responsive your continuous integration system is.
Why Coffee?
A cup of coffee is a natural, human-sized unit of time. If you can push a change, grab a mug, and have results before the bottom of the cup is showing, your feedback loop is short enough to encourage frequent commits. If you are brewing a whole pot before the tests finish, the feedback loop is too long. Developers will start batching changes, deferring commits, or worse, avoiding tests entirely.
The Practical Threshold
The sweet spot is usually in the range of five to ten minutes. That gives CI enough time to build, run a solid unit test suite, and provide a green or red signal without interrupting a developer’s flow. It is also short enough that people don’t wander off and get lost in email or meetings while waiting.
What It Tells You
- If the “cup of coffee” consistently stretches into “cup of soup” territory, you need to optimise builds or split test tiers.
- If results come back faster than the coffee cools, congratulations — you have the foundation for true continuous integration.
- If nobody cares about the time at all, that’s a signal too: your CI pipeline might not be delivering useful feedback.
Still Relevant
Even with today’s powerful build servers, containerised pipelines, and cloud runners, the cup of coffee remains a useful metaphor. It’s not about the literal beverage. It’s about keeping the loop short, humane, and integrated into the rhythm of daily work.