Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(profiling): enable profiling measurement charts if measurements are sent #71258

Merged
merged 1 commit into from
May 28, 2024

Conversation

JonasBa
Copy link
Member

@JonasBa JonasBa commented May 21, 2024

React native uses javascript as the platform value which is used both by browser sdk which doesnt report cpu and memory measures. This means we cant know ahead of time if we expect the measurements and simply enable the charts (this toggles loading and the various no measurement states).

In order to not enable these charts for browser SDKs and confuse users, we take a different approach and enable the charts on demand, once the data has loaded. We miss out on some of the loading states, but this all happens pretty fast as the profile loads, so I dont think it's a big deal in terms of UX.

Fixes #59989

@JonasBa JonasBa requested a review from krystofwoldrich May 21, 2024 16:25
@JonasBa JonasBa requested a review from a team as a code owner May 21, 2024 16:25
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 21, 2024
Copy link

codecov bot commented May 21, 2024

Bundle Report

Changes will increase total bundle size by 140 bytes ⬆️

Bundle name Size Change
app-webpack-bundle-array-push 27.66MB 140 bytes ⬆️

@JonasBa JonasBa changed the title feat(profiling): enable charts if values are sent feat(profiling): enable profiling measurement charts if measurements are sent May 21, 2024
Copy link
Contributor

@viglia viglia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JonasBa in vroom in order to differentiate between browser js and react-native js I check whether the runtime is set to hermes.

I think you could make that check as well so that you don't need a different approach and we won't miss out on some of the loading states as you mentioned.

Snippet here below is an extract from the payload returned to the front-end:

    "runtime": {
        "name": "hermes",
        "version": ""
    },

@JonasBa
Copy link
Member Author

JonasBa commented May 28, 2024

@JonasBa in vroom in order to differentiate between browser js and react-native js I check whether the runtime is set to hermes.

I think you could make that check as well so that you don't need a different approach and we won't miss out on some of the loading states as you mentioned.

Snippet here below is an extract from the payload returned to the front-end:

    "runtime": {
        "name": "hermes",
        "version": ""
    },

The issue is that we need to know this ahead of time in order to show the skeleton and loading UI. If it comes in with the profile response, then it's already too late to show

@JonasBa JonasBa merged commit f45bebe into master May 28, 2024
45 checks passed
@JonasBa JonasBa deleted the jb/profiling/react-native-memory-cpu branch May 28, 2024 13:22
volokluev pushed a commit that referenced this pull request May 28, 2024
…are sent (#71258)

React native uses javascript as the platform value which is used both by
browser sdk which doesnt report cpu and memory measures. This means we
cant know ahead of time if we expect the measurements and simply enable
the charts (this toggles loading and the various no measurement states).

In order to not enable these charts for browser SDKs and confuse users,
we take a different approach and enable the charts on demand, once the
data has loaded. We miss out on some of the loading states, but this all
happens pretty fast as the profile loads, so I dont think it's a big
deal in terms of UX.

Fixes #59989
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show UI frames, CPU and Memory for RN/iOS Mixed Profiles
3 participants