diff --git a/app/assets/javascripts/analytics/shared/constants.js b/app/assets/javascripts/analytics/shared/constants.js index e9d6d121e6d5e5a4c350181ba62f020c09a2817b..9463286e53efbe117fe93c52eb574f1b0c2094aa 100644 --- a/app/assets/javascripts/analytics/shared/constants.js +++ b/app/assets/javascripts/analytics/shared/constants.js @@ -20,10 +20,13 @@ const formatDateParam = (d) => dateFormat(d, dateFormats.isoDate, true); export const METRIC_POPOVER_LABEL = s__('ValueStreamAnalytics|View details'); -export const KEY_METRICS = { +export const ISSUES_COMPLETED_TYPE = 'issues_completed'; + +export const FLOW_METRICS = { LEAD_TIME: 'lead_time', CYCLE_TIME: 'cycle_time', ISSUES: 'issues', + ISSUES_COMPLETED: ISSUES_COMPLETED_TYPE, COMMITS: 'commits', DEPLOYS: 'deploys', }; @@ -38,7 +41,7 @@ export const DORA_METRICS = { const VSA_FLOW_METRICS_GROUP = { key: 'key_metrics', title: s__('ValueStreamAnalytics|Key metrics'), - keys: Object.values(KEY_METRICS), + keys: Object.values(FLOW_METRICS), }; export const VSA_METRICS_GROUPS = [VSA_FLOW_METRICS_GROUP]; @@ -90,7 +93,7 @@ export const METRIC_TOOLTIPS = { projectLink: '-/pipelines/charts?chart=change-failure-rate', docsLink: helpPagePath('user/analytics/dora_metrics', { anchor: 'change-failure-rate' }), }, - [KEY_METRICS.LEAD_TIME]: { + [FLOW_METRICS.LEAD_TIME]: { description: s__('ValueStreamAnalytics|Median time from issue created to issue closed.'), groupLink: '-/analytics/value_stream_analytics', projectLink: '-/value_stream_analytics', @@ -98,7 +101,7 @@ export const METRIC_TOOLTIPS = { anchor: 'view-the-lead-time-and-cycle-time-for-issues', }), }, - [KEY_METRICS.CYCLE_TIME]: { + [FLOW_METRICS.CYCLE_TIME]: { description: s__( "ValueStreamAnalytics|Median time from the earliest commit of a linked issue's merge request to when that issue is closed.", ), @@ -108,13 +111,21 @@ export const METRIC_TOOLTIPS = { anchor: 'view-the-lead-time-and-cycle-time-for-issues', }), }, - [KEY_METRICS.ISSUES]: { + [FLOW_METRICS.ISSUES]: { description: s__('ValueStreamAnalytics|Number of new issues created.'), groupLink: '-/issues_analytics', projectLink: '-/analytics/issues_analytics', docsLink: helpPagePath('user/analytics/issue_analytics'), }, - [KEY_METRICS.DEPLOYS]: { + [FLOW_METRICS.ISSUES_COMPLETED]: { + description: s__('ValueStreamAnalytics|Number of issues closed by month.'), + groupLink: '-/analytics/value_stream_analytics', + projectLink: '-/value_stream_analytics', + docsLink: helpPagePath('user/analytics/value_streams_dashboard', { + anchor: 'dashboard-metrics-and-drill-down-reports', + }), + }, + [FLOW_METRICS.DEPLOYS]: { description: s__('ValueStreamAnalytics|Total number of deploys to production.'), groupLink: '-/analytics/productivity_analytics', projectLink: '-/analytics/merge_request_analytics', diff --git a/doc/user/analytics/value_streams_dashboard.md b/doc/user/analytics/value_streams_dashboard.md index 1a58679cfc020cde49522a0abf26d5d6de9d4bda..4bb29d53ad25b1a9dce23da158eb5dcb11ad5577 100644 --- a/doc/user/analytics/value_streams_dashboard.md +++ b/doc/user/analytics/value_streams_dashboard.md @@ -147,6 +147,7 @@ panels: | Lead time | Median time from issue created to issue closed. | [Value Stream Analytics](https://gitlab.com/groups/gitlab-org/-/analytics/value_stream_analytics) | [View the lead time and cycle time for issues](../group/value_stream_analytics/index.md#key-metrics) | `lead_time` | | Cycle time | Median time from the earliest commit of a linked issue's merge request to when that issue is closed. | [VSA overview](https://gitlab.com/groups/gitlab-org/-/analytics/value_stream_analytics) | [View the lead time and cycle time for issues](../group/value_stream_analytics/index.md#key-metrics) | `cycle_time` | | New issues | Number of new issues created. | [Issue Analytics](https://gitlab.com/groups/gitlab-org/-/issues_analytics) | Issue analytics [for projects](issue_analytics.md) and [for groups](../../user/group/issues_analytics/index.md) | `issues` | +| Closed issues | Number of issues closed by month. | [Value Stream Analytics](https://gitlab.com/groups/gitlab-org/-/analytics/value_stream_analytics) | [Value Stream Analytics](../group/value_stream_analytics/index.md) | `issues_completed` | | Number of deploys | Total number of deploys to production. | [Merge Request Analytics](https://gitlab.com/gitlab-org/gitlab/-/analytics/merge_request_analytics) | [Merge request analytics](merge_request_analytics.md) | `deploys` | | Critical vulnerabilities over time | Critical vulnerabilities over time in project or group | [Vulnerability report](https://gitlab.com/gitlab-org/gitlab/-/security/vulnerability_report) | [Vulnerability report](../application_security/vulnerability_report/index.md) | `vulnerability_critical` | | High vulnerabilities over time | High vulnerabilities over time in project or group | [Vulnerability report](https://gitlab.com/gitlab-org/gitlab/-/security/vulnerability_report) | [Vulnerability report](../application_security/vulnerability_report/index.md) | `vulnerability_high` | diff --git a/ee/app/assets/javascripts/analytics/dashboards/components/comparison_chart.vue b/ee/app/assets/javascripts/analytics/dashboards/components/comparison_chart.vue index b353e0ea0d3a8e06c49ea67fc9151f800934e995..c8deb182aea8f164c21704bc8b42da8d6c0ede45 100644 --- a/ee/app/assets/javascripts/analytics/dashboards/components/comparison_chart.vue +++ b/ee/app/assets/javascripts/analytics/dashboards/components/comparison_chart.vue @@ -3,6 +3,7 @@ import { GlAlert, GlSkeletonLoader } from '@gitlab/ui'; import { joinPaths } from '~/lib/utils/url_utility'; import { createAlert } from '~/alert'; import { fetchMetricsData, toYmd } from '~/analytics/shared/utils'; +import { FLOW_METRICS } from '~/analytics/shared/constants'; import { METRICS_REQUESTS } from '~/analytics/cycle_analytics/constants'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import GroupVulnerabilitiesQuery from '../graphql/group_vulnerabilities.query.graphql'; @@ -105,6 +106,12 @@ export default { fullPath: this.requestPath, }; }, + excludedMetrics() { + return [ + ...this.excludeMetrics, + ...(this.useGraphqlEndpoint ? [] : [FLOW_METRICS.ISSUES_COMPLETED]), + ]; + }, }, async mounted() { this.loadingTable = true; @@ -247,9 +254,11 @@ export default { this.apiQueryFn, ); - const { excludeMetrics } = this; this.tableData = hasDoraMetricValues(timePeriods) - ? generateDoraTimePeriodComparisonTable({ timePeriods, excludeMetrics }) + ? generateDoraTimePeriodComparisonTable({ + timePeriods, + excludeMetrics: this.excludedMetrics, + }) : []; } catch (error) { createAlert({ message: DASHBOARD_LOADING_FAILURE, error, captureError: true }); diff --git a/ee/app/assets/javascripts/analytics/dashboards/components/comparison_table.vue b/ee/app/assets/javascripts/analytics/dashboards/components/comparison_table.vue index 1ab47fea0ce93b14789eb4a3f148fcfbb4ef4f01..1741fe7a982dd46ca0d29af968423d1246e7c891 100644 --- a/ee/app/assets/javascripts/analytics/dashboards/components/comparison_table.vue +++ b/ee/app/assets/javascripts/analytics/dashboards/components/comparison_table.vue @@ -1,5 +1,5 @@