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

Change UI thread naming #20

Merged
merged 3 commits into from
Sep 7, 2022
Merged

Change UI thread naming #20

merged 3 commits into from
Sep 7, 2022

Conversation

MaeIg
Copy link
Contributor

@MaeIg MaeIg commented Sep 6, 2022

Closes #15

Duplicate of #18 to run CI on this repo.

Description

The goal is to replace "com.app.any" in the Threads View by "UI Thread".

I wanted to use detectCurrentAppBundleId in packages/android-performance-profiler/src/commands/cpu/getCpuStatsByProcess.ts but it crashed the e2e-test because the app was not detected each time the function was called. I think it is because we close and open the app a lot during our tests.

So I pass the bundle id in params. I don't know if this is the cleanest way.

It was not working for big bundle id like com.facebook.katana or bigger. So, I used an other method that is to compare processId and pid. If these ids are the same, it is the main thread and we write "UI thread".

Test plan

I manually tested the result on the reporter and it works fine!
image

I also ran tests and updated snapshot.

I don't know how I can manually test flipper-plugin-android-performance-profiler so if you know how to do it I can try.

… "$"

On my phone, this command fails because output is Surface(name=com.example.staging/com.example.MainActivity)
and not Surface(name=com.example.staging/com.example.MainActivity$_0876)
@MaeIg MaeIg mentioned this pull request Sep 6, 2022
@github-actions
Copy link

github-actions bot commented Sep 6, 2022

Flashlight Report 🔦

Copy link
Member

@Almouro Almouro left a comment

Choose a reason for hiding this comment

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

Perfect 🥳

@Almouro Almouro merged commit 0653a46 into main Sep 7, 2022
@Almouro Almouro deleted the change-ui-thread-naming branch September 7, 2022 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename UI thread
2 participants