Startrekzky commented on code in PR #310:
URL: 
https://github.com/apache/incubator-devlake-website/pull/310#discussion_r1011288692


##########
docs/Metrics/DeployTime.md:
##########
@@ -16,11 +16,20 @@ The time it takes from when a PR is merged to when it is 
deployed.
 
 
 ## How is it calculated?
-You can define `deployment` based on your actual practice. For a full list of 
`deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
-
+1. You can define `deployment` based on your actual practice. For a full list 
of `deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+2. Connect pr/mr to the right `deployment`
+![](/img/Metrics/pr-commit-deployment-relation.jpeg)
+   1. Use plugin `refdiff` to calculate `refs_commits_diffs` between any two 
consecutive deployments under the same scope,
+for example, here, we will get commit-2 and commit-3 by calculating 
commits_diff before deployment-1 and deployment-2,
+we can say commit-2, commit-3 and commit-4 are deployed by deployment-2
+   2. Connect pr/mr and commits_diff through merge_commit or pr_commit, for 
example, 

Review Comment:
   Please use a, b, c for sub-list



##########
docs/Metrics/DeployTime.md:
##########
@@ -16,11 +16,20 @@ The time it takes from when a PR is merged to when it is 
deployed.
 
 
 ## How is it calculated?
-You can define `deployment` based on your actual practice. For a full list of 
`deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
-
+1. You can define `deployment` based on your actual practice. For a full list 
of `deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+2. Connect pr/mr to the right `deployment`
+![](/img/Metrics/pr-commit-deployment-relation.jpeg)
+   1. Use plugin `refdiff` to calculate `refs_commits_diffs` between any two 
consecutive deployments under the same scope,

Review Comment:
   We don't need to emphasize 'Use plugin `refdiff` to calculate 
`refs_commits_diffs`' as it's a user manual, just tell how it is calculated is 
OK.
   
   For example:
   Find the [commits diff](the link to refdiff plugin) between two consecutive 
deployments by deployments' commit_sha.



##########
docs/Metrics/DeployTime.md:
##########
@@ -16,11 +16,20 @@ The time it takes from when a PR is merged to when it is 
deployed.
 
 
 ## How is it calculated?
-You can define `deployment` based on your actual practice. For a full list of 
`deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
-
+1. You can define `deployment` based on your actual practice. For a full list 
of `deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+2. Connect pr/mr to the right `deployment`
+![](/img/Metrics/pr-commit-deployment-relation.jpeg)
+   1. Use plugin `refdiff` to calculate `refs_commits_diffs` between any two 
consecutive deployments under the same scope,
+for example, here, we will get commit-2 and commit-3 by calculating 
commits_diff before deployment-1 and deployment-2,
+we can say commit-2, commit-3 and commit-4 are deployed by deployment-2
+   2. Connect pr/mr and commits_diff through merge_commit or pr_commit, for 
example, 
+we get pr-3 connected to commit-3
+   3. Now we can get pr-3's deploy time by finish_time of deployment-2 minus 
merge_time of pr-3.
 <b>Data Sources Required</b>
 
-This metric relies on PR/MRs collected from GitHub or GitLab.
+This metric relies on two sources:
+1. PR/MRs collected from GitHub or GitLab.
+2. CI/CD collected from Github, Gitlab or Jenkins.

Review Comment:
   2. Deployments collected in multiple ways:
   - Open APIs of Jenkins, GitLab, GitHub, etc.
   - Webhook for general CI tools.
   - Releases and PR/MRs from GitHub, GitLab APIs, etc.



##########
docs/Metrics/LeadTimeForChanges.md:
##########
@@ -18,19 +18,22 @@ DORA dashboard. See [live 
demo](https://grafana-lake.demo.devlake.io/grafana/d/q
 ## How is it calculated?
 This metric is calculated by the median cycle time of the PRs deployed in a 
time range. A PR's cycle time is equal to the time a PR was deployed minus the 
PR's first commit's authored_date.
 
-![](https://i.imgur.com/edtqmRE.png)
+![](/img/Metrics/pr-commit-deploy.jpeg)

Review Comment:
   All the doc changes about `Lead Time for Changes`, including calculation 
method, picture and etc can be found in the 'How to Improve' part of this 
issue: https://github.com/apache/incubator-devlake/issues/3516



##########
docs/Metrics/LeadTimeForChanges.md:
##########
@@ -18,19 +18,22 @@ DORA dashboard. See [live 
demo](https://grafana-lake.demo.devlake.io/grafana/d/q
 ## How is it calculated?
 This metric is calculated by the median cycle time of the PRs deployed in a 
time range. A PR's cycle time is equal to the time a PR was deployed minus the 
PR's first commit's authored_date.
 
-![](https://i.imgur.com/edtqmRE.png)
+![](/img/Metrics/pr-commit-deploy.jpeg)

Review Comment:
   All the doc changes about `Lead Time for Changes`, including calculation 
method, picture and etc can be found in the 'How to Improve' part of this 
issue: https://github.com/apache/incubator-devlake/issues/3516



##########
docs/Metrics/DeployTime.md:
##########
@@ -16,11 +16,20 @@ The time it takes from when a PR is merged to when it is 
deployed.
 
 
 ## How is it calculated?
-You can define `deployment` based on your actual practice. For a full list of 
`deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
-
+1. You can define `deployment` based on your actual practice. For a full list 
of `deployment`'s definitions that DevLake support, please refer to [Deployment 
Frequency](/docs/Metrics/DeploymentFrequency.md).
+2. Connect pr/mr to the right `deployment`
+![](/img/Metrics/pr-commit-deployment-relation.jpeg)
+   1. Use plugin `refdiff` to calculate `refs_commits_diffs` between any two 
consecutive deployments under the same scope,
+for example, here, we will get commit-2 and commit-3 by calculating 
commits_diff before deployment-1 and deployment-2,
+we can say commit-2, commit-3 and commit-4 are deployed by deployment-2
+   2. Connect pr/mr and commits_diff through merge_commit or pr_commit, for 
example, 
+we get pr-3 connected to commit-3
+   3. Now we can get pr-3's deploy time by finish_time of deployment-2 minus 
merge_time of pr-3.

Review Comment:
   Please refer to [issue 
3516](https://github.com/apache/incubator-devlake/issues/3516), not all commits 
can be mapped to PRs.



##########
docs/Metrics/LeadTimeForChanges.md:
##########
@@ -18,19 +18,22 @@ DORA dashboard. See [live 
demo](https://grafana-lake.demo.devlake.io/grafana/d/q
 ## How is it calculated?
 This metric is calculated by the median cycle time of the PRs deployed in a 
time range. A PR's cycle time is equal to the time a PR was deployed minus the 
PR's first commit's authored_date.
 
-![](https://i.imgur.com/edtqmRE.png)
+![](/img/Metrics/pr-commit-deploy.jpeg)

Review Comment:
   All the doc changes about `Lead Time for Changes`, including calculation 
method, picture and etc can be found in the 'How to Improve' part of this 
[issue](https://github.com/apache/incubator-devlake/issues/3516) for reference.



-- 
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