Value Stream Analytics (CORE)
Value Stream Analytics measures the time spent to go from an idea to production (also known as cycle time) for each of your projects or groups. Value Stream Analytics displays the median time spent in each stage defined in the process.
Value Stream Analytics is useful in order to quickly determine the velocity of a given 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.
For information on how to contribute to the development of Value Stream Analytics, see our contributor documentation.
Project-level Value Stream Analytics is available via Project > Analytics > Value Stream.
NOTE: Group-level Value Stream Analytics is also available.
The stages tracked by Value Stream Analytics by default represent the GitLab flow. These stages can be customized in Group Level Value Stream Analytics.
- Time to schedule an issue (by milestone or by adding it to an issue board)
- Time to first commit
- Time to create a merge request
- Time it takes GitLab CI/CD to test your code
Review (Merge Request/MR)
- Time spent on code review
Staging (Continuous Deployment)
- Time between merging and deploying to production
Introduced in GitLab 10.0.
GitLab provides the ability to filter analytics based on a date range. To filter results, select one of these options:
- Last 7 days
- Last 30 days (default)
- Last 90 days
How Time metrics are measured
The "Time" metrics near the top of the page are measured as follows:
- Lead time: median time from issue created to issue closed.
- Cycle time: median time from first commit to issue closed.
NOTE: A commit is associated with an issue by crosslinking in the commit message or by manually linking the merge request containing the commit.
How the stages are measured
Value Stream Analytics records stage time and data based on the project issues with the exception of the staging stage, where only data deployed to production are measured.
Specifically, if your CI is not set up and you have not defined a production environment, then you will not have any data for this stage.
Each stage of Value Stream Analytics is further described in the table below.
|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 created for it.|
|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
|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 in the description of the merge request. For example, if the issue is closed with
|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. Data not collected without a production environment.|
How this works, behind the scenes:
- Issues and merge requests are grouped in pairs, where the merge request has the closing pattern for the corresponding issue. Issue/merge request pairs without closing patterns are not included.
- Issue/merge request pairs are filtered by the last XX days, specified through the UI (default = 90 days). Pairs outside the filtered range are not included.
- For the remaining pairs, review information needed for stages, including issue creation date, merge request merge time, and so on.
In short, the Value Stream Analytics dashboard tracks data related to GitLab flow. It does not include data for:
- Merge requests that do not close an issue.
- Issues that do not include labels present in the Issue Board
- Issues without a milestone.
- Staging stages, in projects without a production environment.
How the production environment is identified
Value Stream Analytics identifies production environments by looking for project environments with a name matching any of these patterns:
These patterns are not case-sensitive.
You can change the name of a project environment in your GitLab CI/CD configuration.
Below is a simple fictional workflow of a single cycle that happens in a single day passing through all seven stages. Note that if a stage does not have a start and a stop mark, it is not measured and hence not calculated in the median time. It is assumed that milestones are created and CI for testing and setting environments is configured.
- Issue is created at 09:00 (start of Issue stage).
- Issue is added to a milestone at 11:00 (stop of Issue stage / start of Plan stage).
- Start working on the issue, create a branch locally and make one commit at 12:00.
- Make a second commit to the branch which mentions the issue number at 12.30 (stop of Plan stage / start of Code stage).
- Push branch and create a merge request that contains the issue closing pattern in its description at 14:00 (stop of Code stage / start of Test and Review stages).
- The CI starts running your scripts defined in
.gitlab-ci.ymland takes 5min (stop of Test stage).
- Review merge request, ensure that everything is OK and merge the merge request at 19:00. (stop of Review stage / start of Staging stage).
- Now that the merge request is merged, a deployment to the
productionenvironment starts and finishes at 19:30 (stop of Staging stage).
From the above example we see the time used for each stage:
- Issue: 2h (11:00 - 09:00)
- Plan: 1h (12:00 - 11:00)
- Code: 2h (14:00 - 12:00)
- Test: 5min
- Review: 5h (19:00 - 14:00)
- Staging: 30min (19:30 - 19:00)
- The above example specifies the issue number in a latter commit. The process still collects analytics data for that issue.
- The time required in the Test stage is not included in the overall time of the cycle. It is included in the Review process, as every MR should be tested.
- The example above illustrates only one cycle of the multiple stages. Value Stream Analytics, on its dashboard, shows the calculated median elapsed time for these issues.
The current permissions on the Project-level Value Stream Analytics dashboard are:
- Public projects - anyone can access.
- Internal projects - any authenticated user can access.
- Private projects - any member Guest and above can access.
You can read more about permissions in general.
Learn more about Value Stream Analytics in the following resources: