Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(billing): Add support for PROFILE_DURATION_UI #87452

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion static/gsAdmin/components/planList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ type LimitName =
| 'reservedMonitorSeats'
| 'reservedUptime'
| 'reservedSpans'
| 'reservedProfileDuration';
| 'reservedProfileDuration'
| 'reservedProfileDurationUI';

type Props = {
onLimitChange: (limit: LimitName, value: number) => void;
Expand All @@ -29,6 +30,7 @@ type Props = {
reservedErrors: null | number;
reservedMonitorSeats: null | number;
reservedProfileDuration: null | number;
reservedProfileDurationUI: null | number;
reservedReplays: null | number;
reservedSpans: null | number;
reservedTransactions: null | number;
Expand All @@ -44,6 +46,7 @@ const configurableCategories: DataCategory[] = [
DataCategory.UPTIME,
DataCategory.SPANS,
DataCategory.PROFILE_DURATION,
DataCategory.PROFILE_DURATION_UI,
];

function PlanList({
Expand All @@ -56,6 +59,7 @@ function PlanList({
reservedMonitorSeats,
reservedUptime,
reservedProfileDuration,
reservedProfileDurationUI,
reservedSpans,
onPlanChange,
onLimitChange,
Expand Down Expand Up @@ -155,6 +159,9 @@ function PlanList({
case DataCategory.PROFILE_DURATION:
fieldValue = reservedProfileDuration;
break;
case DataCategory.PROFILE_DURATION_UI:
fieldValue = reservedProfileDurationUI;
break;
case DataCategory.UPTIME:
fieldValue = reservedUptime;
break;
Expand Down
3 changes: 3 additions & 0 deletions static/gsApp/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const MAX_ADMIN_CATEGORY_GIFTS = {
[DataCategory.UPTIME]: 10_000,
[DataCategory.SPANS]: 1_000_000_000,
[DataCategory.PROFILE_DURATION]: 10_000, // TODO(continuous profiling): confirm max amount
[DataCategory.PROFILE_DURATION_UI]: 10_000, // TODO(continuous profiling): confirm max amount
};

// While we no longer offer or support unlimited ondemand we still
Expand All @@ -56,4 +57,6 @@ export const PRODUCT_TRIAL_CATEGORIES: DataCategory[] = [
DataCategory.REPLAYS,
DataCategory.SPANS,
DataCategory.TRANSACTIONS,
DataCategory.PROFILE_DURATION,
DataCategory.PROFILE_DURATION_UI,
];
1 change: 1 addition & 0 deletions static/gsApp/views/subscriptionPage/usageTotals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export function calculateCategoryPrepaidUsage(
prepaidTotal = prepaid * GIGABYTE;
break;
case DataCategory.PROFILE_DURATION:
case DataCategory.PROFILE_DURATION_UI:
prepaidTotal = prepaid * MILLISECONDS_IN_HOUR;
break;
default:
Expand Down
Loading