Startrekzky opened a new issue, #3516:
URL: https://github.com/apache/incubator-devlake/issues/3516

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and 
found no similar feature requirement.
   
   
   ### Description
   
   The existing way to calculate `lead time for changes` can be found in this 
[doc](https://devlake.apache.org/docs/Metrics/LeadTimeForChanges#how-is-it-calculated).
 
   
   The method can be summarized into 4 steps:
   1. Find the `deployments` whose `finished_date` falls into the time range 
that users select
   2. Find the `PRs` related to the `deployments`, a PR's `deployed_date` is 
the nearest deployment's `finished_date`. See pic below, PR 2&3's 
`deployed_date` is Deploy-2's `finished_date`
   3. Calculate each PR's cycle time by "PR deployed_date - PR's first commit's 
authored_date
   4. Find the median PR cycle time, which is the `median lead time for 
changes`.
   
   
![image](https://user-images.githubusercontent.com/14050754/196939729-a90aa360-899b-4b38-a357-025c0a46d811.png)
   
   
   ### Use case
   
   The logic of determining a PR's deployed_date in step 2 may not be that 
accurate, as the current approach is a `date-based fuzzy match`.
   
   Based on the definition of this metric, `the median amount of time for a 
commit to be deployed into production`, a more precise way to calculate is to 
find out the ACTUAL TIME a commit gets deployed.
   
   Therefore, in step 2, I suggested using 
   
   
   
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to