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

Add the ability to gather power usage measurements on Android from USB power meters. #2134

Merged
merged 14 commits into from
May 28, 2024

Conversation

gmierz
Copy link
Collaborator

@gmierz gmierz commented May 21, 2024

This PR adds the ability to gather power from USB power meters that are supported by the usb-power-profiling module: https://github.com/fqueze/usb-power-profiling

The capability is added to both Firefox, and Chromium-based browsers. Some methods are added to the Android class to make it simpler to parse the power usage measurements, and also obtain a full "power profile" of the power usage throughout the full test. The power profile is gathered for each test-iteration/url measured.

@gmierz gmierz requested a review from soulgalore May 21, 2024 16:06
@gmierz
Copy link
Collaborator Author

gmierz commented May 21, 2024

Hi @soulgalore! What do you think about adding the usb-power-profiling module for power measurements on android using USB power meters?

We've found that this is a better approach versus the batterystats method that currently exists in the Android class. If you want, I could remove that older power testing code and make this the primary method of doing power usage testing in Browsertime. The batterystats method is also device-specific whereas this method only requires a supported USB power meter to be able to test on any Android phone.

@soulgalore
Copy link
Member

Hi @gmierz sounds like a good idea, let me test it tomorrow!

@soulgalore
Copy link
Member

Hmm the unit tests started to fail, do they work for you locally @gmierz ?

@gmierz
Copy link
Collaborator Author

gmierz commented May 22, 2024

That's an odd failure. I can reproduce it locally though so I'll look into it.

@gmierz
Copy link
Collaborator Author

gmierz commented May 22, 2024

It works now! There was some code in the usb-power-profiling module that would get run on import and this caused the timeout. I've got a PR up on usb-power-profiling to fix it: fqueze/usb-power-profiling#4

Once it's merged, I'll update the the package used in this PR (currently it's using a custom git commit).

@soulgalore
Copy link
Member

Looks good, lets merge when your fix is published.

@gmierz gmierz merged commit 0007137 into sitespeedio:main May 28, 2024
13 checks passed
@gmierz
Copy link
Collaborator Author

gmierz commented May 28, 2024

Thanks for the review @soulgalore! I've merged the changes with the updated package from npm used now.

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.

2 participants