2021-10-27 15:23:28 +05:30
import {
getValueStreamMetrics ,
METRIC _TYPE _SUMMARY ,
METRIC _TYPE _TIME _SUMMARY ,
} from '~/api/analytics_api' ;
import { _ _ , s _ _ } from '~/locale' ;
2021-09-04 01:27:46 +05:30
export const OVERVIEW _STAGE _ID = 'overview' ;
export const DEFAULT _VALUE _STREAM = {
id : 'default' ,
slug : 'default' ,
name : 'default' ,
} ;
2021-10-27 15:23:28 +05:30
export const NOT _ENOUGH _DATA _ERROR = s _ _ (
"ValueStreamAnalyticsStage|We don't have enough data to show this stage." ,
) ;
export const PAGINATION _TYPE = 'keyset' ;
export const PAGINATION _SORT _FIELD _END _EVENT = 'end_event' ;
export const PAGINATION _SORT _FIELD _DURATION = 'duration' ;
export const PAGINATION _SORT _DIRECTION _DESC = 'desc' ;
export const PAGINATION _SORT _DIRECTION _ASC = 'asc' ;
export const I18N _VSA _ERROR _STAGES = _ _ (
'There was an error fetching value stream analytics stages.' ,
) ;
export const I18N _VSA _ERROR _STAGE _MEDIAN = _ _ ( 'There was an error fetching median data for stages' ) ;
export const I18N _VSA _ERROR _SELECTED _STAGE = _ _ (
'There was an error fetching data for the selected stage' ,
) ;
export const OVERVIEW _METRICS = {
TIME _SUMMARY : 'TIME_SUMMARY' ,
RECENT _ACTIVITY : 'RECENT_ACTIVITY' ,
} ;
export const METRICS _POPOVER _CONTENT = {
'lead-time' : {
description : s _ _ ( 'ValueStreamAnalytics|Median time from issue created to issue closed.' ) ,
} ,
'cycle-time' : {
description : s _ _ (
2021-11-18 22:05:49 +05:30
"ValueStreamAnalytics|Median time from the earliest commit of a linked issue's merge request to when that issue is closed." ,
2021-10-27 15:23:28 +05:30
) ,
} ,
2021-12-11 22:18:48 +05:30
'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.' ,
) ,
} ,
2021-10-27 15:23:28 +05:30
'new-issue' : { description : s _ _ ( 'ValueStreamAnalytics|Number of new issues created.' ) } ,
'new-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' ) ,
} ,
} ;
export const SUMMARY _METRICS _REQUEST = [
{ endpoint : METRIC _TYPE _SUMMARY , name : _ _ ( 'recent activity' ) , request : getValueStreamMetrics } ,
] ;
export const METRICS _REQUESTS = [
{ endpoint : METRIC _TYPE _TIME _SUMMARY , name : _ _ ( 'time summary' ) , request : getValueStreamMetrics } ,
... SUMMARY _METRICS _REQUEST ,
] ;