profileDetails.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import {Fragment, useEffect} from 'react';
  2. import * as Layout from 'sentry/components/layouts/thirds';
  3. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  4. import {t} from 'sentry/locale';
  5. import trackAdvancedAnalyticsEvent from 'sentry/utils/analytics/trackAdvancedAnalyticsEvent';
  6. import {useCurrentProjectFromRouteParam} from 'sentry/utils/profiling/hooks/useCurrentProjectFromRouteParam';
  7. import useOrganization from 'sentry/utils/useOrganization';
  8. import {useParams} from 'sentry/utils/useParams';
  9. import {ProfileGroupProvider} from 'sentry/views/profiling/profileGroupProvider';
  10. import {useProfiles} from 'sentry/views/profiling/profilesProvider';
  11. import {ProfileDetailsTable} from './components/profileDetailsTable';
  12. function ProfileDetails() {
  13. const organization = useOrganization();
  14. const currentProject = useCurrentProjectFromRouteParam();
  15. const profiles = useProfiles();
  16. const params = useParams();
  17. useEffect(() => {
  18. trackAdvancedAnalyticsEvent('profiling_views.profile_summary', {
  19. organization,
  20. project_id: currentProject?.id,
  21. project_platform: currentProject?.platform,
  22. });
  23. // ignore currentProject so we don't block the analytics event
  24. // or fire more than once unnecessarily
  25. // eslint-disable-next-line react-hooks/exhaustive-deps
  26. }, [organization]);
  27. return (
  28. <Fragment>
  29. <SentryDocumentTitle
  30. title={t('Profiling \u2014 Details')}
  31. orgSlug={organization.slug}
  32. >
  33. <Layout.Body>
  34. <Layout.Main fullWidth>
  35. <ProfileGroupProvider
  36. type="flamechart"
  37. input={profiles.type === 'resolved' ? profiles.data : null}
  38. traceID={params.eventID}
  39. >
  40. <ProfileDetailsTable />
  41. </ProfileGroupProvider>
  42. </Layout.Main>
  43. </Layout.Body>
  44. </SentryDocumentTitle>
  45. </Fragment>
  46. );
  47. }
  48. export default ProfileDetails;