Android Battery @ Facebook
summary
Shows how Facebook measures battery in production by instrumenting CPU frequency, radio bytes and tail time, camera open time, location accuracy and wake locks, then maps those proxies to energy using device power profiles so metrics are stable and not noisy. Describes using Android Studio, trepn and power monitors for spot checks, Battery Historian for logs, a CPU spin detector that uploads aggregated stack traces, and an open source battery metrics library. Catches an 11% energy regression, fixes animation and camera leaks and ships.
AI-written summary · about
chapters (25)
- 0:00Introduction to battery monitoring
- 1:26Challenges measuring battery usage
- 3:11Tools for battery debugging
- 5:39Problems with device-level battery metrics
- 8:02Hardware component power modeling
- 10:53CPU power consumption measurement
- 11:14Radio tail energy and batching
- 13:20Camera and location power tracking
- 15:07GPU power measurement difficulties
- 15:50Screen power consumption overview
- 16:52Energy breakdown by app state
- 18:39Secondary process instrumentation
- 19:02Avoiding battery drain from measurement
- 20:26Tracking power metrics across releases
- 21:48Power profile validation and use
- 23:56Detecting battery regressions
- 25:19Thread-level CPU attribution
- 26:22CPU spin detector tool
- 27:25Animation leak detection
- 29:08Network power attribution
- 29:56Camera and location leak detection
- 31:17Wake locks and job scheduler monitoring
- 31:59Key points for battery efficiency
- 34:04Battery Metrics open source library
- 36:11Q&A on React Native and battery
related talks
24mWrangling the CPU iOS Performance in the Facebook App
48mHow to Build Performance-Driven Android Apps
45mHow Open Source Powers Facebook on Android
33mAndroid Benchmarking and other stories
40mAndroid vitals: Debug app performance and reap rewards
41mEngineering for Sustainability: Building a Carbon-Aware App with Android
40mAndroid performance monitoring with automation
33mAndroid Benchmarking and other stories
