stackMarkerToHumanReadable.tsx 533 B

123456789101112131415161718192021
  1. import {t} from 'sentry/locale';
  2. export function stackMarkerToHumanReadable(marker: JSSelfProfiling.Marker): string {
  3. switch (marker) {
  4. case 'gc':
  5. return t('Garbage Collection');
  6. case 'style':
  7. return t('Style');
  8. case 'layout':
  9. return t('Layout');
  10. case 'paint':
  11. return t('Paint');
  12. case 'script':
  13. return t('Script');
  14. case 'other':
  15. return t('Other');
  16. default:
  17. // since spec is still in dev, just gracefully return whatever we received.
  18. return marker;
  19. }
  20. }