constants.ts 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import {t} from 'sentry/locale';
  2. import type {AggregationOutputType} from 'sentry/utils/discover/fields';
  3. export enum MobileCursors {
  4. SPANS_TABLE = 'spansCursor',
  5. SCREENS_TABLE = 'screensCursor',
  6. RELEASE_1_EVENT_SAMPLE_TABLE = 'release1Cursor',
  7. RELEASE_2_EVENT_SAMPLE_TABLE = 'release2Cursor',
  8. }
  9. export enum MobileSortKeys {
  10. RELEASE_1_EVENT_SAMPLE_TABLE = 'release1Samples',
  11. RELEASE_2_EVENT_SAMPLE_TABLE = 'release2Samples',
  12. }
  13. export enum YAxis {
  14. WARM_START = 0,
  15. COLD_START = 1,
  16. TTID = 2,
  17. TTFD = 3,
  18. SLOW_FRAME_RATE = 4,
  19. FROZEN_FRAME_RATE = 5,
  20. THROUGHPUT = 6,
  21. COUNT = 7,
  22. SLOW_FRAMES = 8,
  23. FROZEN_FRAMES = 9,
  24. FRAMES_DELAY = 10,
  25. }
  26. export const YAXIS_COLUMNS: Readonly<Record<YAxis, string>> = {
  27. [YAxis.WARM_START]: 'avg(measurements.app_start_warm)',
  28. [YAxis.COLD_START]: 'avg(measurements.app_start_cold)',
  29. [YAxis.TTID]: 'avg(measurements.time_to_initial_display)',
  30. [YAxis.TTFD]: 'avg(measurements.time_to_full_display)',
  31. [YAxis.SLOW_FRAME_RATE]: 'avg(measurements.frames_slow_rate)',
  32. [YAxis.FROZEN_FRAME_RATE]: 'avg(measurements.frames_frozen_rate)',
  33. [YAxis.THROUGHPUT]: 'tpm()',
  34. [YAxis.COUNT]: 'count()',
  35. // Using span metrics
  36. [YAxis.SLOW_FRAMES]: 'avg(mobile.slow_frames)',
  37. [YAxis.FROZEN_FRAMES]: 'avg(mobile.frozen_frames)',
  38. [YAxis.FRAMES_DELAY]: 'avg(mobile.frames_delay)',
  39. };
  40. export const READABLE_YAXIS_LABELS: Readonly<Record<YAxis, string>> = {
  41. [YAxis.WARM_START]: 'avg(app_start_warm)',
  42. [YAxis.COLD_START]: 'avg(app_start_cold)',
  43. [YAxis.TTID]: 'avg(time_to_initial_display)',
  44. [YAxis.TTFD]: 'avg(time_to_full_display)',
  45. [YAxis.SLOW_FRAME_RATE]: 'avg(frames_slow_rate)',
  46. [YAxis.FROZEN_FRAME_RATE]: 'avg(frames_frozen_rate)',
  47. [YAxis.THROUGHPUT]: 'tpm()',
  48. [YAxis.COUNT]: 'count()',
  49. [YAxis.SLOW_FRAMES]: 'avg(mobile.slow_frames)',
  50. [YAxis.FROZEN_FRAMES]: 'avg(mobile.frozen_frames)',
  51. [YAxis.FRAMES_DELAY]: 'avg(mobile.frames_delay)',
  52. };
  53. export const CHART_TITLES: Readonly<Record<YAxis, string>> = {
  54. [YAxis.WARM_START]: t('Warm Start'),
  55. [YAxis.COLD_START]: t('Cold Start'),
  56. [YAxis.TTID]: t('Time To Initial Display'),
  57. [YAxis.TTFD]: t('Time To Full Display'),
  58. [YAxis.SLOW_FRAME_RATE]: t('Slow Frame Rate'),
  59. [YAxis.FROZEN_FRAME_RATE]: t('Frozen Frame Rate'),
  60. [YAxis.THROUGHPUT]: t('Throughput'),
  61. [YAxis.COUNT]: t('Total Count'),
  62. [YAxis.SLOW_FRAMES]: t('Slow Frames'),
  63. [YAxis.FROZEN_FRAMES]: t('Frozen Frames'),
  64. [YAxis.FRAMES_DELAY]: t('Frames Delay'),
  65. };
  66. export const OUTPUT_TYPE: Readonly<Record<YAxis, AggregationOutputType>> = {
  67. [YAxis.WARM_START]: 'duration',
  68. [YAxis.COLD_START]: 'duration',
  69. [YAxis.TTID]: 'duration',
  70. [YAxis.TTFD]: 'duration',
  71. [YAxis.SLOW_FRAME_RATE]: 'percentage',
  72. [YAxis.FROZEN_FRAME_RATE]: 'percentage',
  73. [YAxis.THROUGHPUT]: 'number',
  74. [YAxis.COUNT]: 'number',
  75. [YAxis.SLOW_FRAMES]: 'number',
  76. [YAxis.FROZEN_FRAMES]: 'number',
  77. [YAxis.FRAMES_DELAY]: 'duration',
  78. };