vitalsDetailsTableQuery.tsx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import {EventsMetaType} from 'sentry/utils/discover/eventView';
  2. import GenericDiscoverQuery, {
  3. DiscoverQueryProps,
  4. GenericChildrenProps,
  5. } from 'sentry/utils/discover/genericDiscoverQuery';
  6. type BaseDataRow = {
  7. [key: string]: React.ReactText;
  8. count: number;
  9. count_unique_user: number;
  10. id: string;
  11. project: string;
  12. team_key_transaction: number;
  13. transaction: string;
  14. };
  15. type LCPDataRow = BaseDataRow & {
  16. compare_numeric_aggregate_p75_measurements_lcp_greater_2500: number;
  17. compare_numeric_aggregate_p75_measurements_lcp_greater_4000: number;
  18. p50_measurements_lcp: number;
  19. p75_measurements_lcp: number;
  20. p95_measurements_lcp: number;
  21. };
  22. type FCPDataRow = BaseDataRow & {
  23. compare_numeric_aggregate_p75_measurements_fcp_greater_2500: number;
  24. compare_numeric_aggregate_p75_measurements_fcp_greater_4000: number;
  25. p50_measurements_fcp: number;
  26. p75_measurements_fcp: number;
  27. p95_measurements_fcp: number;
  28. };
  29. type CLSDataRow = BaseDataRow & {
  30. compare_numeric_aggregate_p75_measurements_cls_greater_2500: number;
  31. compare_numeric_aggregate_p75_measurements_cls_greater_4000: number;
  32. p50_measurements_cls: number;
  33. p75_measurements_cls: number;
  34. p95_measurements_cls: number;
  35. };
  36. type FIDDataRow = BaseDataRow & {
  37. compare_numeric_aggregate_p75_measurements_fid_greater_2500: number;
  38. compare_numeric_aggregate_p75_measurements_fid_greater_4000: number;
  39. p50_measurements_fid: number;
  40. p75_measurements_fid: number;
  41. p95_measurements_fid: number;
  42. };
  43. // TODO(perf): Fix if/once we can send column aliases along with a request
  44. export type TableDataRow = LCPDataRow | FCPDataRow | CLSDataRow | FIDDataRow;
  45. export type TableData = {
  46. data: Array<TableDataRow>;
  47. meta?: EventsMetaType;
  48. };
  49. type ChildrenProps = Omit<GenericChildrenProps<TableData>, 'tableData'> & {
  50. tableData: TableData | null;
  51. };
  52. type QueryProps = DiscoverQueryProps & {
  53. children: (props: ChildrenProps) => React.ReactNode;
  54. };
  55. function VitalsCardsDiscoverQuery(props: QueryProps) {
  56. return <GenericDiscoverQuery<TableData, QueryProps> route="events" {...props} />;
  57. }
  58. export default VitalsCardsDiscoverQuery;