constants.tsx 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. import {t} from 'sentry/locale';
  2. import {measurementType} from 'sentry/utils/discover/fields';
  3. import {MobileVital, WebVital} from 'sentry/utils/fields';
  4. import {Vital} from 'sentry/utils/performance/vitals/types';
  5. export const WEB_VITAL_DETAILS: Record<WebVital, Vital> = {
  6. [WebVital.FP]: {
  7. slug: 'fp',
  8. name: t('First Paint'),
  9. acronym: 'FP',
  10. description: t(
  11. 'Render time of the first pixel loaded in the viewport (may overlap with FCP).'
  12. ),
  13. poorThreshold: 3000,
  14. type: measurementType(WebVital.FP),
  15. },
  16. [WebVital.FCP]: {
  17. slug: 'fcp',
  18. name: t('First Contentful Paint'),
  19. acronym: 'FCP',
  20. description: t(
  21. 'Render time of the first image, text or other DOM node in the viewport.'
  22. ),
  23. poorThreshold: 3000,
  24. type: measurementType(WebVital.FCP),
  25. },
  26. [WebVital.LCP]: {
  27. slug: 'lcp',
  28. name: t('Largest Contentful Paint'),
  29. acronym: 'LCP',
  30. description: t(
  31. 'Render time of the largest image, text or other DOM node in the viewport.'
  32. ),
  33. poorThreshold: 4000,
  34. type: measurementType(WebVital.LCP),
  35. },
  36. [WebVital.FID]: {
  37. slug: 'fid',
  38. name: t('First Input Delay'),
  39. acronym: 'FID',
  40. description: t(
  41. 'Response time of the browser to a user interaction (clicking, tapping, etc).'
  42. ),
  43. poorThreshold: 300,
  44. type: measurementType(WebVital.FID),
  45. },
  46. [WebVital.CLS]: {
  47. slug: 'cls',
  48. name: t('Cumulative Layout Shift'),
  49. acronym: 'CLS',
  50. description: t(
  51. 'Sum of layout shift scores that measure the visual stability of the page.'
  52. ),
  53. poorThreshold: 0.25,
  54. type: measurementType(WebVital.CLS),
  55. },
  56. [WebVital.TTFB]: {
  57. slug: 'ttfb',
  58. name: t('Time to First Byte'),
  59. acronym: 'TTFB',
  60. description: t(
  61. "The time that it takes for a user's browser to receive the first byte of page content."
  62. ),
  63. poorThreshold: 600,
  64. type: measurementType(WebVital.TTFB),
  65. },
  66. [WebVital.RequestTime]: {
  67. slug: 'ttfb.requesttime',
  68. name: t('Request Time'),
  69. acronym: 'RT',
  70. description: t(
  71. 'Captures the time spent making the request and receiving the first byte of the response.'
  72. ),
  73. poorThreshold: 600,
  74. type: measurementType(WebVital.RequestTime),
  75. },
  76. };
  77. export const MOBILE_VITAL_DETAILS: Record<MobileVital, Vital> = {
  78. [MobileVital.AppStartCold]: {
  79. slug: 'app_start_cold',
  80. name: t('App Start Cold'),
  81. description: t(
  82. 'Cold start is a measure of the application start up time from scratch.'
  83. ),
  84. type: measurementType(MobileVital.AppStartCold),
  85. },
  86. [MobileVital.AppStartWarm]: {
  87. slug: 'app_start_warm',
  88. name: t('App Start Warm'),
  89. description: t(
  90. 'Warm start is a measure of the application start up time while still in memory.'
  91. ),
  92. type: measurementType(MobileVital.AppStartWarm),
  93. },
  94. [MobileVital.FramesTotal]: {
  95. slug: 'frames_total',
  96. name: t('Total Frames'),
  97. description: t(
  98. 'Total frames is a count of the number of frames recorded within a transaction.'
  99. ),
  100. type: measurementType(MobileVital.FramesTotal),
  101. },
  102. [MobileVital.FramesSlow]: {
  103. slug: 'frames_slow',
  104. name: t('Slow Frames'),
  105. description: t(
  106. 'Slow frames is a count of the number of slow frames recorded within a transaction.'
  107. ),
  108. type: measurementType(MobileVital.FramesSlow),
  109. },
  110. [MobileVital.FramesFrozen]: {
  111. slug: 'frames_frozen',
  112. name: t('Frozen Frames'),
  113. description: t(
  114. 'Frozen frames is a count of the number of frozen frames recorded within a transaction.'
  115. ),
  116. type: measurementType(MobileVital.FramesFrozen),
  117. },
  118. [MobileVital.FramesSlowRate]: {
  119. slug: 'frames_slow_rate',
  120. name: t('Slow Frames Rate'),
  121. description: t(
  122. 'Slow Frames Rate is the percentage of frames recorded within a transaction that is considered slow.'
  123. ),
  124. type: measurementType(MobileVital.FramesSlowRate),
  125. },
  126. [MobileVital.FramesFrozenRate]: {
  127. slug: 'frames_frozen_rate',
  128. name: t('Frozen Frames Rate'),
  129. description: t(
  130. 'Frozen Frames Rate is the percentage of frames recorded within a transaction that is considered frozen.'
  131. ),
  132. type: measurementType(MobileVital.FramesFrozenRate),
  133. },
  134. [MobileVital.StallCount]: {
  135. slug: 'stall_count',
  136. name: t('Stalls'),
  137. description: t(
  138. 'Stalls is the number of times the application stalled within a transaction.'
  139. ),
  140. type: measurementType(MobileVital.StallCount),
  141. },
  142. [MobileVital.StallTotalTime]: {
  143. slug: 'stall_total_time',
  144. name: t('Total Stall Time'),
  145. description: t(
  146. 'Stall Total Time is the total amount of time the application is stalled within a transaction.'
  147. ),
  148. type: measurementType(MobileVital.StallTotalTime),
  149. },
  150. [MobileVital.StallLongestTime]: {
  151. slug: 'stall_longest_time',
  152. name: t('Longest Stall Time'),
  153. description: t(
  154. 'Stall Longest Time is the longest amount of time the application is stalled within a transaction.'
  155. ),
  156. type: measurementType(MobileVital.StallLongestTime),
  157. },
  158. [MobileVital.StallPercentage]: {
  159. slug: 'stall_percentage',
  160. name: t('Stall Percentage'),
  161. description: t(
  162. 'Stall Percentage is the percentage of the transaction duration the application was stalled.'
  163. ),
  164. type: measurementType(MobileVital.StallPercentage),
  165. },
  166. };
  167. export enum Browser {
  168. CHROME = 'Chrome',
  169. EDGE = 'Edge',
  170. OPERA = 'Opera',
  171. FIREFOX = 'Firefox',
  172. SAFARI = 'Safari',
  173. IE = 'IE',
  174. }