Better Battery Statistics with Battery Historian
Continuing the relentless quest to keep my phone speedy, I stumbled upon a developer tool that is useful to anyone needing to troubleshoot a slow, short-living or overheating phone – Battery Historian
Battery Historian shows you a much more detailed and informative battery stats chart, highlighting the individual apps and sync services which are keeping your phone awake/busy in the background. It also shows network, wifi status, gps and more.
Using this tool I identified that the Facebook Messenger app was waking up to send stats. Also, Google+ was syncing for ~40s in the bakground at times.
tl;dr
$ git clone git@github.com:google/battery-historian.git
$ cd battery-historian
# plug in your device and dump the battery stats
$ adb shell dumpsys batterystats > batterystats.txt
# convert the cryptic text into a pretty html chart
$ python historian.py batterystats.txt > batterystats.html
# open in your browser
$ open batterystats.html
Here are links to the docs and github repo.