Queueing models and arrival forecasts to staff a pull-request review queue
A staffing planner for a review queue: forecast pull-request arrivals, model review as a queue, and show how many reviewers it takes to keep time to first review under a target, using public GitHub activity.
Background
Any team that works through a queue (support tickets, claims, code reviews) has to decide how many people to put on it. Too few and waits grow quickly once arrivals outpace the team; too many and people sit idle. The relationship is not linear: near full capacity, a small rise in arrivals causes a large rise in waiting.
Open-source maintainers face this with pull requests, and coding assistants are making pull requests cheaper to write. This planner uses public GitHub activity to answer the staffing question: how many reviewers does a project need to keep time to first review under a target?
Data
GH Archive: the hourly record of public GitHub events, sampled from 2019 to 2026. Pull-request openings, reviews, comments, merges and closures are rebuilt into one lifecycle per pull request. Only public repositories are visible, and login names are dropped.
How it works
- Lifecycles. For each pull request: when it opened, when it got its first review or maintainer comment, and when and how it closed.
- Arrivals. Weekly pull-request arrivals forecast for each repository group, with uncertainty.
- Service times. Survival analysis of time to first review, treating pull requests still waiting as unfinished rather than dropping them.
- Queue model. Arrivals and review effort feed a queueing model (Erlang C) that gives the expected wait for a given number of active reviewers, checked against a simulation of the queue.
- Staffing. The smallest number of reviewers that keeps the share of pull requests reviewed within the target above a chosen level, now and under the arrival forecast.
Evaluation
Queue predictions are checked against observed waits in held-out periods, and arrival forecasts against what arrived.
Demo
Pick a repository group, set a response-time target and the number of active reviewers, and see the predicted wait, the share of pull requests that miss the target, and how that changes as arrivals grow. A chart shows how waits rise sharply as the queue nears capacity.
GitHub records don't show how much time maintainers actually spend reviewing, so review effort is estimated from activity, and the staffing figures are a planning guide rather than a measured workload.