debian-mirror-gitlab/doc/user/analytics/value_stream_analytics.md

222 lines
12 KiB
Markdown
Raw Normal View History

2020-05-24 23:13:21 +05:30
---
stage: Manage
2021-02-22 17:27:13 +05:30
group: Optimize
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2020-05-24 23:13:21 +05:30
---
2021-03-11 19:13:27 +05:30
# Value Stream Analytics **(FREE)**
2020-03-13 15:44:24 +05:30
> - Introduced as Cycle Analytics prior to GitLab 12.3 at the project level.
2021-09-04 01:27:46 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/12077) in GitLab Premium 12.3 at the group level.
2020-03-13 15:44:24 +05:30
> - [Renamed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23427) from Cycle Analytics to Value Stream Analytics in GitLab 12.8.
Value Stream Analytics measures the time spent to go from an
[idea to production](https://about.gitlab.com/blog/2016/08/05/continuous-integration-delivery-and-deployment-with-gitlab/#from-idea-to-production-with-gitlab)
2021-01-03 14:25:43 +05:30
(also known as cycle time) for each of your projects or groups. Value Stream Analytics displays the median time
2020-03-13 15:44:24 +05:30
spent in each stage defined in the process.
2021-09-04 01:27:46 +05:30
You can use Value Stream Analytics to determine the velocity of a given
2020-03-13 15:44:24 +05:30
project. It points to bottlenecks in the development process, enabling management
to uncover, triage, and identify the root cause of slowdowns in the software development life cycle.
2021-09-04 01:27:46 +05:30
For information about how to contribute to the development of Value Stream Analytics, see our [contributor documentation](../../development/value_stream_analytics.md).
2021-01-03 14:25:43 +05:30
2021-09-04 01:27:46 +05:30
Project-level Value Stream Analytics is available by using **Project > Analytics > Value Stream**.
2021-01-03 14:25:43 +05:30
2021-02-22 17:27:13 +05:30
NOTE:
[Group-level Value Stream Analytics](../group/value_stream_analytics) is also available.
2020-03-13 15:44:24 +05:30
2021-01-03 14:25:43 +05:30
## Default stages
2020-03-13 15:44:24 +05:30
2021-09-04 01:27:46 +05:30
The stages tracked by Value Stream Analytics by default represent the [GitLab flow](../../topics/gitlab_flow.md). You can customize these stages in group-level Value Stream Analytics.
2020-03-13 15:44:24 +05:30
- **Issue** (Tracker)
- Time to schedule an issue (by milestone or by adding it to an issue board)
- **Plan** (Board)
- Time to first commit
- **Code** (IDE)
- Time to create a merge request
- **Test** (CI)
- Time it takes GitLab CI/CD to test your code
2021-09-04 01:27:46 +05:30
- **Review** (Merge request)
2020-03-13 15:44:24 +05:30
- Time spent on code review
- **Staging** (Continuous Deployment)
- Time between merging and deploying to production
2021-11-18 22:05:49 +05:30
## Filter Value Stream Analytics data
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/326701) in GitLab 14.3
You can filter analytics based on the following parameters:
- Milestones (Group level)
- Labels (Group level)
- Author
- Assignees
To filter results:
1. Select the **Filter results** text box.
1. Select a parameter.
1. Select a value. To find a value in the list, enter the value name.
![Value stream analytics filter bar](img/project_vsa_filter_v14_3.png "Active filter bar for a project's Value Stream Analytics")
2020-10-24 23:57:45 +05:30
### Date ranges
2020-03-13 15:44:24 +05:30
2021-09-04 01:27:46 +05:30
To filter analytics results based on a date range,
select different **From** and **To** days
from the date picker (default: last 30 days).
2020-03-13 15:44:24 +05:30
2021-11-18 22:05:49 +05:30
### Stage table
> Sorting the stage table [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/335974) in GitLab 14.4.
![Value Stream Analytics Stage table](img/project_vsa_stage_table_v14_4.png "Project VSA stage table")
The stage table shows a list of related workflow items for the selected stage. This can include:
- CI/CD jobs
- Issues
- Merge requests
- Pipelines
A little badge next to the workflow items table header shows the number of workflow items that
completed the selected stage.
The stage table also includes the **Time** column, which shows how long it takes each item to pass
through the selected value stream stage.
To sort the stage table by a table column, select the table header.
You can sort in ascending or descending order. To find items that spent the most time in a stage,
potentially causing bottlenecks in your value stream, sort the table by the **Time** column.
From there, select individual items to drill in and investigate how delays are happening.
To see which items most recently exited the stage, sort by the work item column on the left.
The table displays 20 items per page. If there are more than 20 items, you can use the
**Prev** and **Next** buttons to navigate through the pages.
2020-06-23 00:09:42 +05:30
## How Time metrics are measured
2020-03-13 15:44:24 +05:30
2021-09-04 01:27:46 +05:30
The **Time** metrics near the top of the page are measured as follows:
2020-06-23 00:09:42 +05:30
2021-09-04 01:27:46 +05:30
- **Lead time**: Median time from issue created to issue closed.
- **Cycle time**: Median time from first commit to issue closed. (You can associate a commit with an issue by [crosslinking in the commit message](../project/issues/crosslinking_issues.md#from-commit-messages).)
2022-01-26 12:08:38 +05:30
- **Lead Time for Changes**: median duration between merge request merge and deployment to a production environment for all MRs deployed in the given time period. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/340150) in GitLab 14.5 (Ultimate only).
## Deployment metrics (**PREMIUM**)
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/337256) in GitLab 11.3.
Value Stream Analytics exposes two deployment related metrics near the top of the page:
- **Deploys:** The number of successful deployments in the date range.
- **Deployment Frequency:** The average number of successful deployments.
The deployment metrics calculation uses the same method as the
[group-level Value Stream Analytics](../group/value_stream_analytics/index.md#how-metrics-are-measured).
Both of them are based on the [DORA API](../../api/dora/metrics.md#devops-research-and-assessment-dora-key-metrics-api).
2020-06-23 00:09:42 +05:30
## How the stages are measured
2021-09-30 23:02:18 +05:30
Value Stream Analytics uses start events and end events to measure the time that an issue or merge request spends in each stage.
2021-09-04 01:27:46 +05:30
For example, a stage might start when one label is added to an issue and end when another label is added.
2021-09-30 23:02:18 +05:30
Items aren't included in the stage time calculation if they have not reached the end event.
2020-03-13 15:44:24 +05:30
2021-09-04 01:27:46 +05:30
| Stage | Description |
|---------|---------------|
2021-11-11 11:23:49 +05:30
| Issue | Measures the median time between creating an issue and taking action to solve it, by either labeling it or adding it to a milestone, whichever comes first. The label is tracked only if it already includes an [issue board list](../project/issue_board.md) created for it. |
2021-09-04 01:27:46 +05:30
| Plan | Measures the median time between the action you took for the previous stage, and pushing the first commit to the branch. That first branch commit triggers the separation between **Plan** and **Code**, and at least one of the commits in the branch must include the related issue number (such as `#42`). If the issue number is *not* included in a commit, that data is not included in the measurement time of the stage. |
| Code | Measures the median time between pushing a first commit (previous stage) and creating a merge request (MR). The process is tracked with the [issue closing pattern](../project/issues/managing_issues.md#closing-issues-automatically) in the description of the merge request. For example, if the issue is closed with `Closes #xxx`, it's assumed that `xxx` is issue number for the merge request). If there is no closing pattern, the start time is set to the create time of the first commit. |
| Test | Essentially the start to finish time for all pipelines. Measures the median time to run the entire pipeline for that project. Related to the time required by GitLab CI/CD to run every job for the commits pushed to that merge request, as defined in the previous stage. |
| Review | Measures the median time taken to review merge requests with a closing issue pattern, from creation to merge. |
| Staging | Measures the median time between merging the merge request (with a closing issue pattern) to the first deployment to a [production environment](#how-the-production-environment-is-identified). Data not collected without a production environment. |
2020-03-13 15:44:24 +05:30
2021-09-04 01:27:46 +05:30
How this works:
2020-03-13 15:44:24 +05:30
2021-02-22 17:27:13 +05:30
1. Issues and merge requests are grouped in pairs, where the merge request has the
[closing pattern](../project/issues/managing_issues.md#closing-issues-automatically)
2021-09-04 01:27:46 +05:30
for the corresponding issue. Issue and merge request pairs without closing patterns are
not included.
1. Issue and merge request pairs are filtered by the last XX days, specified through the UI
(default is `90` days). Pairs outside the filtered range are not included.
2021-02-22 17:27:13 +05:30
1. For the remaining pairs, review information needed for stages, including
2021-09-04 01:27:46 +05:30
issue creation date and merge request merge time.
2020-03-13 15:44:24 +05:30
2021-02-22 17:27:13 +05:30
In short, the Value Stream Analytics dashboard tracks data related to [GitLab flow](../../topics/gitlab_flow.md). It does not include data for:
2020-03-13 15:44:24 +05:30
- Merge requests that do not close an issue.
2021-11-11 11:23:49 +05:30
- Issues that do not include labels present in the issue board.
2021-02-22 17:27:13 +05:30
- Issues without a milestone.
- Staging stages, in projects without a [production environment](#how-the-production-environment-is-identified).
2021-01-03 14:25:43 +05:30
## How the production environment is identified
2021-09-04 01:27:46 +05:30
Value Stream Analytics identifies production environments based on the
[deployment tier of environments](../../ci/environments/index.md#deployment-tier-of-environments).
2020-03-13 15:44:24 +05:30
## Example workflow
2021-09-04 01:27:46 +05:30
Here's a fictional workflow of a single cycle that happens in a
single day, passing through all seven stages. If a stage doesn't have
a start and a stop mark, it isn't measured and hence isn't calculated in the median
time. It's assumed that milestones are created, and CI for testing and setting
2020-03-13 15:44:24 +05:30
environments is configured.
1. Issue is created at 09:00 (start of **Issue** stage).
2021-09-04 01:27:46 +05:30
1. Issue is added to a milestone at 11:00 (stop of **Issue** stage and start of
2020-03-13 15:44:24 +05:30
**Plan** stage).
2021-09-04 01:27:46 +05:30
1. Start working on the issue, create a branch locally, and make one commit at
2020-03-13 15:44:24 +05:30
12:00.
2021-09-04 01:27:46 +05:30
1. Make a second commit to the branch that mentions the issue number at 12:30
(stop of **Plan** stage and start of **Code** stage).
1. Push branch, and create a merge request that contains the [issue closing pattern](../project/issues/managing_issues.md#closing-issues-automatically)
in its description at 14:00 (stop of **Code** stage and start of **Test** and
2020-03-13 15:44:24 +05:30
**Review** stages).
2021-09-30 23:02:18 +05:30
1. The CI starts running your scripts defined in [`.gitlab-ci.yml`](../../ci/yaml/index.md) and
2021-09-04 01:27:46 +05:30
takes 5 minutes (stop of **Test** stage).
1. Review merge request, ensure that everything is okay, and then merge the merge
request at 19:00 (stop of **Review** stage and start of **Staging** stage).
1. The merge request is merged, and a deployment to the `production`
2020-03-13 15:44:24 +05:30
environment starts and finishes at 19:30 (stop of **Staging** stage).
2021-09-04 01:27:46 +05:30
From the previous example we see the time used for each stage:
2020-03-13 15:44:24 +05:30
2021-09-04 01:27:46 +05:30
- **Issue**: 2 hrs (09:00 to 11:00)
- **Plan**: 1 hr (11:00 to 12:00)
- **Code**: 2 hrs (12:00 to 14:00)
2021-10-27 15:23:28 +05:30
- **Test**: 5 minutes
2021-09-04 01:27:46 +05:30
- **Review**: 5 hrs (14:00 to 19:00)
2021-10-27 15:23:28 +05:30
- **Staging**: 30 minutes (19:00 to 19:30)
2020-03-13 15:44:24 +05:30
2021-02-22 17:27:13 +05:30
More information:
2020-04-08 14:13:33 +05:30
2021-09-04 01:27:46 +05:30
- Although the previous example specifies the issue number in a later commit, the process
still collects analytics data for the issue.
- The time required in the **Test** stage isn't included in the overall time of
the cycle. The time is included in the **Review** process, as every merge request should be
2021-02-22 17:27:13 +05:30
tested.
2021-09-04 01:27:46 +05:30
- The previous example illustrates only one cycle of the multiple stages. Value
2021-02-22 17:27:13 +05:30
Stream Analytics, on its dashboard, shows the calculated median elapsed time
for these issues.
2020-04-22 19:07:51 +05:30
2020-03-13 15:44:24 +05:30
## Permissions
2021-09-04 01:27:46 +05:30
The permissions for the project-level Value Stream Analytics dashboard include:
2020-03-13 15:44:24 +05:30
2021-09-04 01:27:46 +05:30
| Project type | Permissions |
|--------------|---------------------------------------|
| Public | Anyone can access |
| Internal | Any authenticated user can access |
| Private | Any member Guest and above can access |
2020-03-13 15:44:24 +05:30
2020-11-24 15:15:51 +05:30
You can [read more about permissions](../../user/permissions.md) in general.
2020-03-13 15:44:24 +05:30
## More resources
2021-09-04 01:27:46 +05:30
Learn more about Value Stream Analytics with the following resources:
2020-03-13 15:44:24 +05:30
2020-04-22 19:07:51 +05:30
- [Value Stream Analytics feature page](https://about.gitlab.com/stages-devops-lifecycle/value-stream-analytics/).
2020-03-13 15:44:24 +05:30
- [Value Stream Analytics feature preview](https://about.gitlab.com/blog/2016/09/16/feature-preview-introducing-cycle-analytics/).
- [Value Stream Analytics feature highlight](https://about.gitlab.com/blog/2016/09/21/cycle-analytics-feature-highlight/).