2022-10-11 01:57:18 +05:30
import { masks } from '~/lib/dateformat' ;
2022-04-04 11:22:00 +05:30
import { s _ _ } from '~/locale' ;
2023-04-23 21:23:45 +05:30
import { helpPagePath } from '~/helpers/help_page_helper' ;
2021-09-30 23:02:18 +05:30
export const DATE _RANGE _LIMIT = 180 ;
export const PROJECTS _PER _PAGE = 50 ;
const { isoDate , mediumDate } = masks ;
export const dateFormats = {
isoDate ,
defaultDate : mediumDate ,
defaultDateTime : 'mmm d, yyyy h:MMtt' ,
2021-11-18 22:05:49 +05:30
month : 'mmmm' ,
2021-09-30 23:02:18 +05:30
} ;
2022-04-04 11:22:00 +05:30
2023-04-23 21:23:45 +05:30
export const METRIC _POPOVER _LABEL = s _ _ ( 'ValueStreamAnalytics|View details' ) ;
export const KEY _METRICS = {
LEAD _TIME : 'lead_time' ,
CYCLE _TIME : 'cycle_time' ,
ISSUES : 'issues' ,
COMMITS : 'commits' ,
DEPLOYS : 'deploys' ,
} ;
export const DORA _METRICS = {
DEPLOYMENT _FREQUENCY : 'deployment_frequency' ,
LEAD _TIME _FOR _CHANGES : 'lead_time_for_changes' ,
TIME _TO _RESTORE _SERVICE : 'time_to_restore_service' ,
CHANGE _FAILURE _RATE : 'change_failure_rate' ,
} ;
export const VSA _METRICS _GROUPS = [
{
key : 'key_metrics' ,
title : s _ _ ( 'ValueStreamAnalytics|Key metrics' ) ,
keys : Object . values ( KEY _METRICS ) ,
} ,
{
key : 'dora_metrics' ,
title : s _ _ ( 'ValueStreamAnalytics|DORA metrics' ) ,
keys : Object . values ( DORA _METRICS ) ,
} ,
] ;
export const METRIC _TOOLTIPS = {
[ DORA _METRICS . DEPLOYMENT _FREQUENCY ] : {
description : s _ _ (
'ValueStreamAnalytics|Average number of deployments to production per day. This metric measures how often value is delivered to end users.' ,
) ,
groupLink : '-/analytics/ci_cd?tab=deployment-frequency' ,
projectLink : '-/pipelines/charts?chart=deployment-frequency' ,
docsLink : helpPagePath ( 'user/analytics/dora_metrics' , { anchor : 'deployment-frequency' } ) ,
} ,
[ DORA _METRICS . LEAD _TIME _FOR _CHANGES ] : {
description : s _ _ (
'ValueStreamAnalytics|The time to successfully deliver a commit into production. This metric reflects the efficiency of CI/CD pipelines.' ,
) ,
groupLink : '-/analytics/ci_cd?tab=lead-time' ,
projectLink : '-/pipelines/charts?chart=lead-time' ,
docsLink : helpPagePath ( 'user/analytics/dora_metrics' , { anchor : 'lead-time-for-changes' } ) ,
} ,
[ DORA _METRICS . TIME _TO _RESTORE _SERVICE ] : {
description : s _ _ (
'ValueStreamAnalytics|The time it takes an organization to recover from a failure in production.' ,
) ,
groupLink : '-/analytics/ci_cd?tab=time-to-restore-service' ,
projectLink : '-/pipelines/charts?chart=time-to-restore-service' ,
docsLink : helpPagePath ( 'user/analytics/dora_metrics' , { anchor : 'time-to-restore-service' } ) ,
} ,
[ DORA _METRICS . CHANGE _FAILURE _RATE ] : {
description : s _ _ (
'ValueStreamAnalytics|Percentage of deployments that cause an incident in production.' ,
) ,
groupLink : '-/analytics/ci_cd?tab=change-failure-rate' ,
projectLink : '-/pipelines/charts?chart=change-failure-rate' ,
docsLink : helpPagePath ( 'user/analytics/dora_metrics' , { anchor : 'change-failure-rate' } ) ,
} ,
[ KEY _METRICS . LEAD _TIME ] : {
description : s _ _ ( 'ValueStreamAnalytics|Median time from issue created to issue closed.' ) ,
groupLink : '-/analytics/value_stream_analytics' ,
projectLink : '-/value_stream_analytics' ,
docsLink : helpPagePath ( 'user/analytics/value_stream_analytics' , {
anchor : 'view-the-lead-time-and-cycle-time-for-issues' ,
} ) ,
} ,
[ KEY _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." ,
) ,
groupLink : '-/analytics/value_stream_analytics' ,
projectLink : '-/value_stream_analytics' ,
docsLink : helpPagePath ( 'user/analytics/value_stream_analytics' , {
anchor : 'view-the-lead-time-and-cycle-time-for-issues' ,
} ) ,
} ,
[ KEY _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 ] : {
description : s _ _ ( 'ValueStreamAnalytics|Total number of deploys to production.' ) ,
groupLink : '-/analytics/productivity_analytics' ,
projectLink : '-/analytics/merge_request_analytics' ,
docsLink : helpPagePath ( 'user/analytics/merge_request_analytics' ) ,
} ,
} ;
// TODO: Remove this once the migration to METRIC_TOOLTIPS is complete
// https://gitlab.com/gitlab-org/gitlab/-/issues/388067
2022-04-04 11:22:00 +05:30
export const METRICS _POPOVER _CONTENT = {
lead _time : {
description : s _ _ ( 'ValueStreamAnalytics|Median time from issue created to issue closed.' ) ,
} ,
cycle _time : {
description : s _ _ (
"ValueStreamAnalytics|Median time from the earliest commit of a linked issue's merge request to when that issue is closed." ,
) ,
} ,
lead _time _for _changes : {
description : s _ _ (
'ValueStreamAnalytics|Median time between merge request merge and deployment to a production environment for all MRs deployed in the given time period.' ,
) ,
} ,
issues : { description : s _ _ ( 'ValueStreamAnalytics|Number of new issues created.' ) } ,
deploys : { description : s _ _ ( 'ValueStreamAnalytics|Total number of deploys to production.' ) } ,
deployment _frequency : {
description : s _ _ ( 'ValueStreamAnalytics|Average number of deployments to production per day.' ) ,
} ,
commits : {
description : s _ _ ( 'ValueStreamAnalytics|Number of commits pushed to the default branch' ) ,
} ,
2022-07-16 23:28:13 +05:30
time _to _restore _service : {
description : s _ _ (
'ValueStreamAnalytics|Median time an incident was open on a production environment in the given time period.' ,
) ,
} ,
change _failure _rate : {
description : s _ _ (
'ValueStreamAnalytics|Percentage of deployments that cause an incident in production.' ,
) ,
} ,
2022-04-04 11:22:00 +05:30
} ;