Skip to content

Commit d7a8490

Browse files
committed
feat(usage): Rename metrics to metricSecond
Currently this is only used in the stats_v2 api but needs to line up with the metricSecond we're adding for billing. Should not be merged before #70442
1 parent 2dbccba commit d7a8490

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

static/app/constants/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ export const DATA_CATEGORY_INFO = {
318318
titleName: t('Cron Monitors'),
319319
uid: 13,
320320
},
321-
[DataCategoryExact.METRICS]: {
322-
name: DataCategoryExact.METRICS,
323-
apiName: 'metrics',
321+
[DataCategoryExact.METRIC_SECOND]: {
322+
name: DataCategoryExact.METRIC_SECOND,
323+
apiName: 'metricSecond',
324324
plural: 'metrics',
325325
displayName: 'metrics',
326326
titleName: t('Metrics'),

static/app/types/core.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export enum DataCategory {
8080
PROFILES = 'profiles',
8181
REPLAYS = 'replays',
8282
MONITOR_SEATS = 'monitorSeats',
83+
METRIC_SECOND = 'metricSecond',
8384
}
8485

8586
/**
@@ -97,7 +98,7 @@ export enum DataCategoryExact {
9798
TRANSACTION_INDEXED = 'transaction_indexed',
9899
MONITOR = 'monitor',
99100
MONITOR_SEAT = 'monitorSeat',
100-
METRICS = 'metrics',
101+
METRIC_SECOND = 'metricSecond',
101102
}
102103

103104
export interface DataCategoryInfo {

static/app/views/organizationStats/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export class OrganizationStats extends Component<OrganizationStatsProps> {
263263
if (opt.value === DATA_CATEGORY_INFO.replay.plural) {
264264
return organization.features.includes('session-replay');
265265
}
266-
if (opt.value === DATA_CATEGORY_INFO.metrics.plural) {
266+
if (opt.value === DATA_CATEGORY_INFO.metricSecond.plural) {
267267
return hasMetricStats(organization);
268268
}
269269
return true;
@@ -321,7 +321,7 @@ export class OrganizationStats extends Component<OrganizationStatsProps> {
321321
if (opt.value === DATA_CATEGORY_INFO.replay.plural) {
322322
return organization.features.includes('session-replay');
323323
}
324-
if (opt.value === DATA_CATEGORY_INFO.metrics.plural) {
324+
if (opt.value === DATA_CATEGORY_INFO.metricSecond.plural) {
325325
return hasMetricStats(organization);
326326
}
327327
return true;

static/app/views/organizationStats/usageChart/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ export const CHART_OPTIONS_DATACATEGORY: CategoryOption[] = [
8989
yAxisMinInterval: 100,
9090
},
9191
{
92-
label: DATA_CATEGORY_INFO.metrics.titleName,
93-
value: DATA_CATEGORY_INFO.metrics.plural,
92+
label: DATA_CATEGORY_INFO.metricSecond.titleName,
93+
value: DATA_CATEGORY_INFO.metricSecond.plural,
9494
disabled: false,
9595
yAxisMinInterval: 100,
9696
},
@@ -361,7 +361,7 @@ function UsageChartBody({
361361

362362
const filteredOptions = useMemo(() => {
363363
return categoryOptions.filter(option => {
364-
if (option.value !== DATA_CATEGORY_INFO.metrics.plural) {
364+
if (option.value !== DATA_CATEGORY_INFO.metricSecond.plural) {
365365
return true;
366366
}
367367
return (

static/app/views/organizationStats/usageStatsOrg.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class UsageStatsOrganization<
136136
{
137137
query: {
138138
...this.endpointQuery,
139-
category: DATA_CATEGORY_INFO.metrics.apiName,
139+
category: DATA_CATEGORY_INFO.metricSecond.apiName,
140140
groupBy: ['outcome'],
141141
},
142142
},
@@ -159,7 +159,7 @@ class UsageStatsOrganization<
159159
...group,
160160
by: {
161161
...group.by,
162-
category: DATA_CATEGORY_INFO.metrics.apiName,
162+
category: DATA_CATEGORY_INFO.metricSecond.apiName,
163163
},
164164
};
165165
});
@@ -345,7 +345,7 @@ class UsageStatsOrganization<
345345
filtered: {
346346
title: tct('Filtered [dataCategory]', {dataCategory: dataCategoryName}),
347347
help:
348-
dataCategory === DATA_CATEGORY_INFO.metrics.plural
348+
dataCategory === DATA_CATEGORY_INFO.metricSecond.plural
349349
? tct(
350350
'Filtered metrics were blocked due to your disabled metrics [settings: settings]',
351351
{

static/app/views/organizationStats/usageStatsPerMin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function UsageStatsPerMin({dataCategory, organization, projectIds}: Props) {
7878
};
7979

8080
// Metrics stats ingestion is delayed, so we can't show this for metrics right now
81-
if (dataCategory === DATA_CATEGORY_INFO.metrics.plural) {
81+
if (dataCategory === DATA_CATEGORY_INFO.metricSecond.plural) {
8282
return null;
8383
}
8484

0 commit comments

Comments
 (0)