Skip to content

Commit

Permalink
feat(profileHours): Add profile hours to org stats (#71882)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper authored Jun 4, 2024
1 parent 556bbaa commit 79fff19
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions static/app/views/organizationStats/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ export class OrganizationStats extends Component<OrganizationStatsProps> {
if (DATA_CATEGORY_INFO.transaction.plural === opt.value) {
return !organization.features.includes('spans-usage-tracking');
}
if (DATA_CATEGORY_INFO.profileDuration.plural === opt.value) {
return organization.features.includes('continuous-profiling');
}
return true;
});

Expand Down
6 changes: 6 additions & 0 deletions static/app/views/organizationStats/usageChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ export const CHART_OPTIONS_DATACATEGORY: CategoryOption[] = [
disabled: false,
yAxisMinInterval: 100,
},
{
label: DATA_CATEGORY_INFO.profileDuration.titleName,
value: DATA_CATEGORY_INFO.profileDuration.plural,
disabled: false,
yAxisMinInterval: 100,
},
];

export enum ChartDataTransform {
Expand Down
5 changes: 4 additions & 1 deletion static/app/views/organizationStats/usageStatsOrg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,10 @@ class UsageStatsOrganization<
: group.by.category;

// HACK: The backend enum are singular, but the frontend enums are plural
if (!dataCategory.includes(`${category}`)) {
const fullDataCategory = Object.values(DATA_CATEGORY_INFO).find(
data => data.plural === dataCategory
);
if (fullDataCategory?.apiName !== category) {
return;
}

Expand Down

0 comments on commit 79fff19

Please sign in to comment.