Skip to main content

time_to_first_review

Function time_to_first_review 

Source
pub fn time_to_first_review(opened_at: f64, first_response_at: f64) -> f64
Expand description

Time to first review: the interval from a pull request being opened to a reviewer’s first substantive comment or approval.

The book identifies this as “usually the dominant wait-time contributor” within the review stage, and improving it typically produces the largest single improvement to overall cycle time available to a team.

§Arguments

  • opened_at — the time the pull request was opened (any consistent time unit, e.g. hours since epoch).
  • first_response_at — the time of the reviewer’s first substantive comment or approval, in the same unit.

§Returns

The elapsed time between opening and first review response, in the same unit as the inputs.

§Examples

use software_engineering::pull_request_metrics::time_to_first_review;

// Opened at hour 10, first reviewed at hour 34: an 18-hour wait.
assert_eq!(time_to_first_review(10.0, 34.0), 24.0);