metricHistory.ts 872 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import {DataCategory} from 'sentry/types/core';
  2. import type {BillingMetricHistory} from 'getsentry/types';
  3. const ORDERED_CATEGORIES = [
  4. DataCategory.ERRORS,
  5. DataCategory.TRANSACTIONS,
  6. DataCategory.REPLAYS,
  7. DataCategory.SPANS,
  8. DataCategory.MONITOR_SEATS,
  9. DataCategory.ATTACHMENTS,
  10. ];
  11. export function MetricHistoryFixture(
  12. params: Partial<BillingMetricHistory>
  13. ): BillingMetricHistory {
  14. const order = params.category
  15. ? ORDERED_CATEGORIES.indexOf(params.category as DataCategory)
  16. : 1;
  17. return {
  18. category: DataCategory.ERRORS,
  19. free: 0,
  20. onDemandBudget: 0,
  21. onDemandSpendUsed: 0,
  22. onDemandCpe: 0,
  23. onDemandQuantity: 0,
  24. sentUsageWarning: false,
  25. softCapType: null,
  26. order,
  27. prepaid: 5_000,
  28. reserved: 5_000,
  29. trueForward: false,
  30. usage: 0,
  31. usageExceeded: false,
  32. customPrice: 0,
  33. ...params,
  34. };
  35. }