Skip to content

Commit 79fff19

Browse files
authored
feat(profileHours): Add profile hours to org stats (#71882)
1 parent 556bbaa commit 79fff19

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

static/app/views/organizationStats/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ export class OrganizationStats extends Component<OrganizationStatsProps> {
244244
if (DATA_CATEGORY_INFO.transaction.plural === opt.value) {
245245
return !organization.features.includes('spans-usage-tracking');
246246
}
247+
if (DATA_CATEGORY_INFO.profileDuration.plural === opt.value) {
248+
return organization.features.includes('continuous-profiling');
249+
}
247250
return true;
248251
});
249252

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

+6
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ export const CHART_OPTIONS_DATACATEGORY: CategoryOption[] = [
101101
disabled: false,
102102
yAxisMinInterval: 100,
103103
},
104+
{
105+
label: DATA_CATEGORY_INFO.profileDuration.titleName,
106+
value: DATA_CATEGORY_INFO.profileDuration.plural,
107+
disabled: false,
108+
yAxisMinInterval: 100,
109+
},
104110
];
105111

106112
export enum ChartDataTransform {

static/app/views/organizationStats/usageStatsOrg.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,10 @@ class UsageStatsOrganization<
445445
: group.by.category;
446446

447447
// HACK: The backend enum are singular, but the frontend enums are plural
448-
if (!dataCategory.includes(`${category}`)) {
448+
const fullDataCategory = Object.values(DATA_CATEGORY_INFO).find(
449+
data => data.plural === dataCategory
450+
);
451+
if (fullDataCategory?.apiName !== category) {
449452
return;
450453
}
451454

0 commit comments

Comments
 (0)