profilingTable.tsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import {Location} from 'history';
  2. import GridEditable, {COL_WIDTH_UNDEFINED} from 'sentry/components/gridEditable';
  3. import {t} from 'sentry/locale';
  4. import {Trace} from 'sentry/types/profiling/trace';
  5. import {ProfilingTableCell} from './profilingTableCell';
  6. import {TableColumnKey, TableColumnOrders} from './types';
  7. interface ProfilingTableProps {
  8. location: Location;
  9. traces: Trace[];
  10. }
  11. function ProfilingTable({location, traces}: ProfilingTableProps) {
  12. return (
  13. <GridEditable
  14. isLoading={false}
  15. data={traces}
  16. columnOrder={COLUMN_ORDER.map(key => COLUMNS[key])}
  17. columnSortBy={[]}
  18. grid={{renderBodyCell: ProfilingTableCell}}
  19. location={location}
  20. />
  21. );
  22. }
  23. const COLUMN_ORDER: TableColumnKey[] = [
  24. 'id',
  25. 'failed',
  26. 'app_version',
  27. 'interaction_name',
  28. 'start_time_unix',
  29. 'trace_duration_ms',
  30. 'device_model',
  31. 'device_class',
  32. ];
  33. const COLUMNS: TableColumnOrders = {
  34. id: {
  35. key: 'id',
  36. name: t('Flamegraph'),
  37. width: COL_WIDTH_UNDEFINED,
  38. },
  39. failed: {
  40. key: 'failed',
  41. name: t('Status'),
  42. width: COL_WIDTH_UNDEFINED,
  43. },
  44. app_version: {
  45. key: 'app_version',
  46. name: t('Version'),
  47. width: COL_WIDTH_UNDEFINED,
  48. },
  49. interaction_name: {
  50. key: 'interaction_name',
  51. name: t('Interaction Name'),
  52. width: COL_WIDTH_UNDEFINED,
  53. },
  54. start_time_unix: {
  55. key: 'start_time_unix',
  56. name: t('Timestamp'),
  57. width: COL_WIDTH_UNDEFINED,
  58. },
  59. trace_duration_ms: {
  60. key: 'trace_duration_ms',
  61. name: t('Duration'),
  62. width: COL_WIDTH_UNDEFINED,
  63. },
  64. device_model: {
  65. key: 'device_model',
  66. name: t('Device Model'),
  67. width: COL_WIDTH_UNDEFINED,
  68. },
  69. device_class: {
  70. key: 'device_class',
  71. name: t('Device Class'),
  72. width: COL_WIDTH_UNDEFINED,
  73. },
  74. };
  75. export {ProfilingTable};