Lead Time Improved Calculation
Note that the 202404.1.1 Release introduced a new calculation logic for computing the Lead Time metric.
Lead Time is a metric that measures the total time taken for an issue (e.g., a new feature, bug fix, or any other code change) to move through the entire software delivery pipeline, from the initial creation of the issue to its final release into production.
The new calculation logic uses the time of the entry into each stage, rather than the exit time from that stage. This means that the Lead Time for a particular stage is calculated as the time taken for the issue to reach that stage for the first time, rather than the time spent in that stage itself.
The Lead Time for a stage is calculated as the time difference between the start time of the current stage and the start time of the previous stage.
Lead Time for a Stage = Start Time of the Current Stage - Start Time of the Previous Stage
Total Lead Time = Sum of the Lead Time of all the Individual Stages
The Total Lead Time is calculated by summing the Lead Time of all the individual stages.
This change impacts the following reports:
- Issue Lead Time By Stage report
- Issue Lead Time By Type report
- SCM PR Lead Time by Stage report
- DORA Lead Time for Changes report.
This feature is currently in BETA and is behind a Feature Flag. Contact Harness Support to enable this feature.
Calculation Example
In this example, we consider a use case where a single pull request (PR) is associated with a single Jira ticket. The new Lead Time calculation with stages for Issue Management, CI/CD Platform and SCM is displayed below.
The table provides details on the different stages, their descriptions, formulas, and an example calculation.
Stage | Description | Formula | Example |
---|---|---|---|
Ticket In Progress Time | The time taken for a ticket to move from the Created state to the In Progress state for the first time. | In Progress Time - Ticket Created Time | 10:00 AM - 9:50 AM = 10 minutes |
First Commit Time | The time taken to make the first commit after the ticket is in progress. | First Commit Time - First In Progress Time | 10:05 AM - 10:00 AM = 5 minutes |
First Pull Request Creation Time | The time when the first pull request (PR) was created after the first commit. | First PR Creation Time - First Commit Time | 10:10 AM - 10:05 AM = 5 minutes |
First Pull Request Approval Time | The time taken for the first approval after the first pull request was created. | First PR Approval Time - PR Creation Time | 10:11 AM - 10:10 AM = 1 minute |
Last Pull Request Merge Time | The time taken to merge the pull request after it was approved. | Last PR Merged Time - First PR Approval Time | 10:15 AM - 10:11 AM = 4 minutes |
First Continuous Integration Time | The time taken to complete the continuous integration (CI) pipelines for the first time after the last pull request is merged. | CI Completion Time for First Time - Last PR Merged Time | 10:16 AM - 10:15 AM = 1 minute |
First Continuous Deployment Time | The time taken for the continuous deployment (CD) pipelines to complete for the first time after the CI process is finished. | CD Completion Time for First Time - CI Completion Time for First Time | 10:17 AM - 10:16 AM = 1 minute |
First Issue Management Done Time | The time taken to mark the issue as Done in the Issue Management System (e.g., Jira) after the CD process is completed. | Time at which the JIRA was marked as Done status for the First Time - CD Completion Time for First Time | 10:20 AM - 10:17 AM = 3 minutes |
First Release Time | The time at which the fix version added to the issue is released in Jira after the issue was marked as Done for the first time. | Jira Release Time - Time at which the JIRA was marked as Done status for the First Time | 11:00 AM - 10:20 AM = 40 minutes |
Total Lead Time
The Total Lead Time is calculated by summing the time differences between consecutive stages:
Substituting the example values, we get:
Total Lead Time = 10 min + 5 min + 5 min + 1 min + 4 min + 1 min + 1 min + 3 min + 40 min = 70 minutes
Therefore, the Total Lead Time for this example is 70 minutes.
Note that for the Lead Time calculation, if an issue moves to the same status multiple times during its lifecycle, only the first transition to that status is used for calculating the Lead Time for that particular stage.