Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Add battery debugging doc #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add battery debugging doc #56

wants to merge 1 commit into from

Conversation

colintheshots
Copy link
Contributor

No description provided.

Copy link
Contributor

@mcomella mcomella left a comment

Choose a reason for hiding this comment

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

lgtm w/ nits but I wouldn't mind looking over the changes if you wanted me to! Thanks for writing docs! :)

@@ -0,0 +1,35 @@
Android Performance Profiling can be quite tricky in spite of the wealth of good tools available. This doc is to explain how to track down battery and performance issues.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: add a title, e.g.

# Battery Debugging


Battery Historian starts from the premise that most battery problems are caused by excessive wake locks. It helps the programmer by showing wake locks, when the WiFi or cellular radio is being kept awake, and the rate of battery drain at different times. Focus and Klar do not require wake locks and they wouldn't be interesting, since the apps remain in the foreground most of the time the app is running.

Analyzing Battery Historian results can still prove interesting. [Here are the instructions](https://developer.android.com/studio/profile/battery-historian) to try.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can they still prove interesting? Perhaps you can provide an example?


[Here's more](https://developer.android.com/studio/profile/android-profiler) on how to use the Android Profiler in general. [Here's more on the CPU Profiler](https://developer.android.com/studio/profile/cpu-profiler) specifically.

## Systrace
Copy link
Contributor

Choose a reason for hiding this comment

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

Are Systrace and Traceview useful to diagnosing battery issues because they also help you find high CPU usage? I wonder if these + Android Profiler should fit under a higher category of debugging CPU usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I originally wrote this document for Focus, since Focus has a uniquely different situation than most apps on Android. Using a foreground service most of the time means we must consider CPU usage while the app is backgrounded and idle.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants