-
Notifications
You must be signed in to change notification settings - Fork 30
Add battery debugging doc #56
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.