Skip to content
代码片段 群组 项目
未验证 提交 32d0191b 编辑于 作者: Ezekiel Kigbo's avatar Ezekiel Kigbo 提交者: GitLab
浏览文件

Minor AI impact utils improvements

上级 88ad395c
No related branches found
No related tags found
无相关合并请求
......@@ -234,7 +234,7 @@ export const METRIC_TOOLTIPS = {
},
[AI_METRICS.CODE_SUGGESTIONS_USAGE_RATE]: {
description: s__(
'ValueStreamAnalytics|Monthly user engagement with AI Code Suggestions. Percentage ratio calculated as monthly unique Code Suggestions users / total monthly unique code contributors.',
'AiImpactAnalytics|Monthly user engagement with AI Code Suggestions. Percentage ratio calculated as monthly unique Code Suggestions users / total monthly unique code contributors.',
),
groupLink: '',
projectLink: '',
......
......@@ -18,7 +18,7 @@ import {
generateTableRows,
} from '../utils';
import {
TABLE_METRICS,
AI_IMPACT_TABLE_METRICS,
SUPPORTED_DORA_METRICS,
SUPPORTED_FLOW_METRICS,
SUPPORTED_VULNERABILITY_METRICS,
......@@ -99,7 +99,7 @@ export default {
// Return an array of the failed metric IDs
return result
.reduce((acc, { reason = [] }) => acc.concat(reason), [])
.map((metric) => TABLE_METRICS[metric].label);
.map((metric) => AI_IMPACT_TABLE_METRICS[metric].label);
},
async fetchTableMetrics({ metrics, queryFn }) {
......
......@@ -20,14 +20,14 @@ export const SUPPORTED_VULNERABILITY_METRICS = [VULNERABILITY_METRICS.CRITICAL];
export const SUPPORTED_AI_METRICS = [AI_METRICS.CODE_SUGGESTIONS_USAGE_RATE];
export const TABLE_METRICS = {
export const AI_IMPACT_TABLE_METRICS = {
...pick(VSD_TABLE_METRICS, [
...SUPPORTED_FLOW_METRICS,
...SUPPORTED_DORA_METRICS,
...SUPPORTED_VULNERABILITY_METRICS,
]),
[AI_METRICS.CODE_SUGGESTIONS_USAGE_RATE]: {
label: s__('DORA4Metrics|Code Suggestions usage'),
label: s__('AiImpactAnalytics|Code Suggestions usage'),
units: UNITS.PERCENT,
},
};
......@@ -7,10 +7,10 @@ import {
nSecondsBefore,
} from '~/lib/utils/datetime_utility';
import { formatMetric, percentChange, isMetricInTimePeriods } from '../utils';
import { TABLE_METRICS } from './constants';
import { AI_IMPACT_TABLE_METRICS } from './constants';
const getStartOfMonth = (now) => dateAtFirstDayOfMonth(getStartOfDay(now));
const getColumnKeyForMonth = (monthsAgo) => `${monthsAgo}-months-ago`;
const getStartOfMonth = (now) => dateAtFirstDayOfMonth(getStartOfDay(now));
/**
* Generates the time period columns, from This month -> 5 months ago.
......@@ -76,7 +76,7 @@ export const generateTableColumns = (now) => [
* @returns {Array} array of data-less table rows
*/
export const generateSkeletonTableData = () =>
Object.entries(TABLE_METRICS).map(([identifier, { label, invertTrendColor }]) => ({
Object.entries(AI_IMPACT_TABLE_METRICS).map(([identifier, { label, invertTrendColor }]) => ({
metric: { identifier, value: label },
invertTrendColor,
}));
......@@ -118,7 +118,7 @@ const buildTableRow = ({ identifier, units, timePeriods }) => {
* @returns {Object} object containing the same data, formatted for the table
*/
export const generateTableRows = (timePeriods) =>
Object.entries(TABLE_METRICS).reduce((acc, [identifier, { units }]) => {
Object.entries(AI_IMPACT_TABLE_METRICS).reduce((acc, [identifier, { units }]) => {
if (!isMetricInTimePeriods(identifier, timePeriods)) return acc;
return Object.assign(acc, {
......
......@@ -4,7 +4,7 @@ import { joinPaths, mergeUrlParams } from '~/lib/utils/url_utility';
import { METRIC_TOOLTIPS } from '~/analytics/shared/constants';
import { s__ } from '~/locale';
import { TABLE_METRICS } from '../constants';
import { TABLE_METRICS as AI_IMPACT_TABLE_METRICS } from '../ai_impact/constants';
import { AI_IMPACT_TABLE_METRICS } from '../ai_impact/constants';
export default {
name: 'MetricTableCell',
......
......@@ -4642,6 +4642,12 @@ msgstr ""
msgid "AiAnalytics|the ClickHouse data store is not available"
msgstr ""
 
msgid "AiImpactAnalytics|Code Suggestions usage"
msgstr ""
msgid "AiImpactAnalytics|Monthly user engagement with AI Code Suggestions. Percentage ratio calculated as monthly unique Code Suggestions users / total monthly unique code contributors."
msgstr ""
msgid "Akismet"
msgstr ""
 
......@@ -15970,9 +15976,6 @@ msgstr ""
msgid "DORA4Metrics|Change failure rate (percentage)"
msgstr ""
 
msgid "DORA4Metrics|Code Suggestions usage"
msgstr ""
msgid "DORA4Metrics|Contributor count"
msgstr ""
 
......@@ -56215,9 +56218,6 @@ msgstr ""
msgid "ValueStreamAnalytics|Merge request analytics"
msgstr ""
 
msgid "ValueStreamAnalytics|Monthly user engagement with AI Code Suggestions. Percentage ratio calculated as monthly unique Code Suggestions users / total monthly unique code contributors."
msgstr ""
msgid "ValueStreamAnalytics|New Value Stream"
msgstr ""
 
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册