GithubHelp home page GithubHelp logo

google / battery-historian Goto Github PK

View Code? Open in Web Editor NEW
5.3K 271.0 952.0 4.3 MB

Battery Historian is a tool to analyze battery consumers using Android "bugreport" files.

License: Other

Python 2.97% Go 45.26% JavaScript 36.53% Protocol Buffer 8.57% Shell 0.05% CSS 0.82% HTML 5.81%

battery-historian's Introduction

Battery Historian

Battery Historian is a tool to inspect battery related information and events on an Android device running Android 5.0 Lollipop (API level 21) and later, while the device was not plugged in. It allows application developers to visualize system and application level events on a timeline with panning and zooming functionality, easily see various aggregated statistics since the device was last fully charged, and select an application and inspect the metrics that impact battery specific to the chosen application. It also allows an A/B comparison of two bugreports, highlighting differences in key battery related metrics.

Getting Started

Using Docker

Install Docker.

Run the Battery Historian image. Choose a port number and replace <port> with that number in the commands below:

docker -- run -p <port>:9999 gcr.io/android-battery-historian/stable:3.0 --port 9999

For Linux and Mac OS X:

  • That's it, you're done! Historian will be available at http://localhost:<port>.

For Windows:

  • You may have to enable Virtualization in your BIOS.

  • Once you start Docker, it should tell you the IP address of the machine it is using. If, for example, the IP address is 123.456.78.90, Historian will be available at http://123.456.78.90:<port>.

For more information about the port forwarding, see the Docker documentation.

Building from source code

Make sure you have at least Golang version 1.8.1:

  • Follow the instructions available at http://golang.org/doc/install for downloading and installing the Go compilers, tools, and libraries.
  • Create a workspace directory according to the instructions at http://golang.org/doc/code.html#Organization.
  • Ensure that GOPATH and GOBIN environment variables are appropriately set and added to your $PATH environment variable. $GOBIN should be set to $GOPATH/bin.
    • For Windows, you may set environment variables through the "Environment Variables" button on the "Advanced" tab of the "System" control panel. Some versions of Windows provide this control panel through the "Advanced System Settings" option inside the "System" control panel.

    • For Linux and Mac OS X, you can add the following lines to your ~/.bashrc or ~/.profile files (assuming your workspace is $HOME/work):

      export GOPATH=$HOME/work
      export GOBIN=$GOPATH/bin
      export PATH=$PATH:$GOBIN
      

Next, install Git from https://git-scm.com/downloads if it's not already installed.

Next, make sure Python 2.7 (NOT Python 3!) is installed. See https://python.org/downloads if it isn't, and ensure that python is added to your $PATH environment variable.

Next, install Java from http://www.oracle.com/technetwork/java/javase/downloads/index.html.

Next, download the Battery Historian code and its dependencies:

$ go get -d -u github.com/google/battery-historian/...

Finally, run Battery Historian!

$ cd $GOPATH/src/github.com/google/battery-historian

# Compile Javascript files using the Closure compiler
$ go run setup.go

# Run Historian on your machine (make sure $PATH contains $GOBIN)
$ go run cmd/battery-historian/battery-historian.go [--port <default:9999>]

Remember, you must always run battery-historian from inside the $GOPATH/src/github.com/google/battery-historian directory:

cd $GOPATH/src/github.com/google/battery-historian
go run cmd/battery-historian/battery-historian.go [--port <default:9999>]

How to take a bug report

To take a bug report from your Android device, you will need to enable USB debugging under Settings > System > Developer Options. On Android 4.2 and higher, the Developer options screen is hidden by default. You can enable this by following the instructions here.

To obtain a bug report from your development device running Android 7.0 and higher:

$ adb bugreport bugreport.zip

For devices 6.0 and lower:

$ adb bugreport > bugreport.txt

Start analyzing!

You are all set now. Run historian and visit http://localhost:9999 and upload the bugreport.txt file to start analyzing.

Screenshots

Timeline:

Timeline

System stats:

System

App stats:

App

Advanced

To reset aggregated battery stats and history:

adb shell dumpsys batterystats --reset
Wakelock analysis

By default, Android does not record timestamps for application-specific userspace wakelock transitions even though aggregate statistics are maintained on a running basis. If you want Historian to display detailed information about each individual wakelock on the timeline, you should enable full wakelock reporting using the following command before starting your experiment:

adb shell dumpsys batterystats --enable full-wake-history

Note that by enabling full wakelock reporting the battery history log overflows in a few hours. Use this option for short test runs (3-4 hrs).

Kernel trace analysis

To generate a trace file which logs kernel wakeup source and kernel wakelock activities:

First, connect the device to the desktop/laptop and enable kernel trace logging:

$ adb root
$ adb shell

# Set the events to trace.
$ echo "power:wakeup_source_activate" >> /d/tracing/set_event
$ echo "power:wakeup_source_deactivate" >> /d/tracing/set_event

# The default trace size for most devices is 1MB, which is relatively low and might cause the logs to overflow.
# 8MB to 10MB should be a decent size for 5-6 hours of logging.

$ echo 8192 > /d/tracing/buffer_size_kb

$ echo 1 > /d/tracing/tracing_on

Then, use the device for intended test case.

Finally, extract the logs:

$ echo 0 > /d/tracing/tracing_on
$ adb pull /d/tracing/trace <some path>

# Take a bug report at this time.
$ adb bugreport > bugreport.txt

Note:

Historian plots and relates events in real time (PST or UTC), whereas kernel trace files logs events in jiffies (seconds since boot time). In order to relate these events there is a script which approximates the jiffies to utc time. The script reads the UTC times logged in the dmesg when the system suspends and resumes. The scope of the script is limited to the amount of timestamps present in the dmesg. Since the script uses the dmesg log when the system suspends, there are different scripts for each device, with the only difference being the device-specific dmesg log it tries to find. These scripts have been integrated into the Battery Historian tool itself.

Power monitor analysis

Lines in power monitor files should have one of the following formats, and the format should be consistent throughout the entire file:

<timestamp in epoch seconds, with a fractional component> <amps> <optional_volts>

OR

<timestamp in epoch milliseconds> <milliamps> <optional_millivolts>

Entries from the power monitor file will be overlaid on top of the timeline plot.

To ensure the power monitor and bug report timelines are somewhat aligned, please reset the batterystats before running any power monitor logging:

adb shell dumpsys batterystats --reset

And take a bug report soon after stopping power monitor logging.

If using a Monsoon:

Download the AOSP Monsoon Python script from https://android.googlesource.com/platform/cts/+/master/tools/utils/monsoon.py

# Run the script.
$ monsoon.py --serialno 2294 --hz 1 --samples 100000 -timestamp | tee monsoon.out

# ...let device run a while...

$ stop monsoon.py
Modifying the proto files

If you want to modify the proto files (pb/*/*.proto), first download the additional tools necessary:

Install the standard C++ implementation of protocol buffers from https://github.com/google/protobuf/blob/master/src/README.md

Download the Go proto compiler:

$ go get -u github.com/golang/protobuf/protoc-gen-go

The compiler plugin, protoc-gen-go, will be installed in $GOBIN, which must be in your $PATH for the protocol compiler, protoc, to find it.

Make your changes to the proto files.

Finally, regenerate the compiled Go proto output files using regen_proto.sh.

Other command line tools
# System stats
$ go run cmd/checkin-parse/local_checkin_parse.go --input=bugreport.txt

# Timeline analysis
$ go run cmd/history-parse/local_history_parse.go --summary=totalTime --input=bugreport.txt

# Diff two bug reports
$ go run cmd/checkin-delta/local_checkin_delta.go --input=bugreport_1.txt,bugreport_2.txt

Support

If you've found an error in this project, please file an issue: https://github.com/google/battery-historian/issues

License

Copyright 2016 Google, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

battery-historian's People

Contributors

ashish-s-sharma avatar jocelyndang avatar kwadkore avatar naokigoogle avatar peastham avatar tjohns avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

battery-historian's Issues

json: unsupported value: NaN

I installed battery-historian successfully . However uploading a bugreport leads to json: unsupported value: NaN

2016/03/30 12:15:18 Listening on port:  9999
2016/03/30 12:15:30 Trace starting analysisServer processing for: GET
2016/03/30 12:15:30 Trace finished analysisServer processing for: GET
2016/03/30 12:15:30 Trace starting analysisServer processing for: GET
2016/03/30 12:15:30 Trace finished analysisServer processing for: GET
2016/03/30 12:15:36 Trace starting analysisServer processing for: POST
2016/03/30 12:15:36 Trace starting reading uploaded file. 13902706 bytes
2016/03/30 12:15:37 Trace started analyzing file.
2016/03/30 12:15:37 Trace finished processing summary data.
2016/03/30 12:15:37 Trace finished generating Historian plot.
2016/03/30 12:15:37 Trace finished processing checkin.
2016/03/30 12:15:38 Trace finished generating Historian plot and summaries.
2016/03/30 12:15:39 Trace ended analyzing file.
2016/03/30 12:15:39 Trace finished analysisServer processing for: POST

The Bugreport was taken with adb bugreport > bugreport_a.txt and this is my go version: go version go1.2.1 linux/amd64

Setup broken

Running go get -u github.com/google/battery-historian fetches the Historian code but fails to fetch dependencies:

package github.com/google/battery-historian
    imports github.com/google/battery-historian
    imports github.com/google/battery-historian: no buildable Go source files in /home/historian/Go/src/github.com/google/battery-historian

Running setup.sh gives me (among other things), this:

third_party/closure-library/closure/goog/base_module_test.html:1: ERROR - Parse error. primary expression expected
<!DOCTYPE html>
 ^

third_party/closure-library/closure/goog/base_test.html:1: ERROR - Parse error. primary expression expected
<!DOCTYPE html>
 ^

third_party/closure-library/closure/goog/defineclass_test.html:1: ERROR - Parse error. primary expression expected
<!DOCTYPE html>
 ^

3 error(s), 21 warning(s

Compilation of tests seems to be the issue as running rm third_party/closure-library/closure/goog/*_test.html beforehand results in successful compilation.

Unknown option: --enable

The comments suggest running the command below. This fails for me on adb 1.0.31 on my Moto X.

$ adb shell dumpsys batterystats --enable full-wake-history
Unknown option: --enable

$ adb version
Android Debug Bridge version 1.0.31

Bluetooth creates with invalid table row

I captured a bugreport, and the fille generated by battery historian creates an invalid row for the gviz datatable.

Here is the invalid row generated. Notice that the start time is after the end time.
['bluetooth', '+bluetooth(+14h02m50s-+11h43m27s)', new Date(14,07,01,14,39,49), new Date(14,07,01,12,20,27)],

Trace files not being read when submitted via Firefox

I have been unable to get files to finish being uploaded from Firefox on Windows 10. I see the log line saying "2015/12/23 10:54:33 Trace Starting reading uploaded file. 17164062 bytes", but nothing happens after that and the browser shows no evidence of the file upload.

I switched to using Google Chrome and do not experience this issue on Chrome.

For reference, my Firefox version is 43.0.2 and my Chrome version is 47.0.2526.106 m.

Consider adopting Bazel Closure Rules

Greetings. I notice you have Closure Library unit tests in your project, e.g. bar_data_test.js. Internally you use Blaze rules to test this project. But externally, you have no way of running these tests. This puts your open source contributors at a disadvantage, because they have no way of testing their contributions. They have to ask a Googler to patch and run their change for them.

Consider adopting Bazel with Closure Rules and Go Rules. You will be able to have the same build system externally as you use internally. All your tests, will be able to run on Travis CI too, including browser tests.

Closure Rules offers another advantage: no more GenJsDeps. The Closure Rules behave basically the same as Java rules. It's so much nicer.

Let me know if there's anything I can do to help.

Errors Parsing Device Dumps

Using an Android 5.0.1 test device (or emulator) the following steps will create a stats dump that historian will crash on parsing (steps are per the header comments in the script):

  • adb shell dumpsys batterystats --enable full-wake-history
  • adb shell dumpsys batterystats --reset
  • Swipe around launcher for a few seconds
  • adb shell dumpsys batterystats > outfile.txt

Attempting to parse the above file with historian outfile.txt produces the following crash:

Traceback (most recent call last):
  File "~/bin/historian", line 1247, in <module>
    main()
  File "~/bin/historian", line 1050, in main
    legacy_mode = is_file_legacy_mode(input_file)
  File "~/bin/historian", line 231, in is_file_legacy_mode
    line_time = line.split()[0]
IndexError: list index out of range

Additionally, historian cannot parse a stats dump generated for a single process. Steps to reproduce:

  • adb shell dumpsys batterystats --enable full-wake-history
  • adb shell dumpsys batterystats --reset
  • Launch browser and use for a short while
  • adb shell dumpsys batterystats com.android.browser > outfile.txt

Attempting to parse the above file with historian outfile.txt hangs the script as it blocks waiting for more input. It looks as though this is because the per-process dump does not have the "Battery History" header that historian is hard-coded to look for.

Here is a link to a gist with sample dumps of both conditions: https://gist.github.com/devunwired/e8d240d1f00a30c060cd

From the header comments, it may be that the tools is not meant to handle output directly from dumpsys batterystats, however from the SDK site this is not clear (https://developer.android.com/about/versions/android-5.0.html#Power). In that event, the fix to this may instead just be more graceful error handling (i.e. "you're using the wrong file dummy, do this instead...") rather than hanging or crashing. A more explicit README on this project might help to document the proper uses as well.

Slight change to error message for when closure-compiler ZIP can't be downloaded

I'm behind a corporate proxy which does all kinds of nasty things, so I get this:

C:...\src\github.com\google\battery-historian>go run setup.go

Downloading Closure compiler...
Failed to download Closure compiler: Get http://dl.google.com/closure-compiler/compiler-20160208.zip: dial tcp 198.70.248.227:80: i/o timeout

If this persists, please manually download the compiler from http://dl.google.com/closure-compiler/compiler-20160208.zip into the C:...\src\github.com\google\battery-historian/third_party/closure-compiler directory, unzip it into the C:...\src\github.com\google\battery-historian/third_party/closure-compiler diretory, and rerun this script.

Looking in the go script, it expects the ZIP file to be there, not to be unzipped/extracted:

    _, errF := os.Stat(path.Join(closureCompilerDir, closureCompilerZip))
    if os.IsNotExist(errD) || os.IsNotExist(errF) {
        fmt.Println("\nDownloading Closure compiler...")

So I'd change the wording a bit later on to:

fmt.Printf("\nIf this persists, please manually download the compiler from %s, place it into the %s directory, and rerun this script.\n\n", closureCompilerURL, closureCompilerDir, closureCompilerDir)

I'd submit a pull request but I'm honestly too dumb to know how to do that.

event category not found

I'm getting the following errors trying to run a battery historian on a bug report from the latest Nexus 7 preview build running Lollipop. I didn't see these messages running the original L build from Google IO.

event category not found: user
event category not found: userfg

Thoughts?

README doesn't exist

A README would be a nice addition to this repository now that this lib is picking up ground.

ERR_CONNECTION_RESET found on localhost

I started the server successfully, but after I clicked the submit button, the page got blank, and I could see an error in the console which said 'failed to load resource ERR_CONNECTION_RESET'. I didn't see this issue when I launched the service. Could you please give some suggestions. Thanks a lot.

Could not analyze bug report generated on Android N Preview

When I posted a bug report generated on Android N Preview, Battery Historian just stopped working with the following log and the UI stayed at "Analyzing..." status.

Any report format changes introduced in Android N?

2016/04/26 17:30:15 Listening on port:  9999
2016/04/26 17:30:18 Trace starting analysisServer processing for: GET
2016/04/26 17:30:18 Trace finished analysisServer processing for: GET
2016/04/26 17:30:19 Trace starting analysisServer processing for: GET
2016/04/26 17:30:19 Trace finished analysisServer processing for: GET
2016/04/26 17:30:24 Trace starting analysisServer processing for: POST
2016/04/26 17:30:24 Trace starting reading uploaded file. 22327437 bytes
2016/04/26 17:30:24 Trace started analyzing file.
2016/04/26 17:30:25 Trace finished generating Historian plot.

Graphics scaling issue

Run battery historian on a display with a high dpi with a non standard test size (scaling factor) for example 200% scaling. The X axis scales perfectly, The y-axis makes the correct size space but in this example only fills the top 1/2 of the space and looks rather poor.

Please make the sure the y-axis graph scales correctly.

Otherwise really useful application.

The chart is never show.

As the title of my question. When i want to see the detail of battery historian. It just show Please wait, drawing chart... but i never saw the chart.

And here is my Proc/stat summary

  • Total User Time: 0ms
  • Total System Time: 0ms
  • Total IO Time: 0ms
  • Total Irq Time: 0ms
  • Total Soft Irq Time: 0ms
  • Total Idle Time: 0ms

Why all the data is 0ms..

Did someone experienced the same problem with me?

Can't read bug-report.txt in http://localhost:9999/

image

Upload Bugreport html can be open but can't read but-report.txt and after a while browser changed nothing apparently when I choose a file in file browser and confirm, and the terminmal didn't show any log.
Mayby someone meet before such this problem or do you have any suggestion?
Envrionment:Mac, Chrome and python 2.7

nexus 5 heating problem

my nexus 5 just 2 weeks old, it heats up heavily it still in stock android but yet heats up

How to see individual app battery status when batterystats are taken for specific package?

  1. adb shell dumpsys batterystats --reset
    then performed operations after disconnecting the device to power source/USB.

Generated the bug report:
2. adb shell dumpsys batterystats --charged/unplugged {package_name} > bugreport.txt

Created HTML:
3. python historian.py bugreport.txt > battery.html

This does not create 'battery.html' for a specific package.
if I don't give the package name. it works fine.

But my requirement is to generate battery.html file only for specific packages.

Are there suggestions on how should I do it?

Thanks in Advance.

wrong description in the repo

The current description says

Battery Historian is a tool to analyze battery consumers using Android "bugreport" files.

should be i guess

Battery Historian is a tool to analyze battery consumption using Android "bugreport" files.

ERROR - Duplicate input: third_party/closure-library/closure/goog/base.js

When i run following command on my windows following the steps of phob( http://ph0b.com/battery-historian-2-0-windows/), it didn't work and created the following error message:

java -jar third
_party\closure-compiler\compiler.jar --closure_entry_point historian.Historian -
-js js*.js --js third_party\closure-library\closure\goog\base.js --js third_par
ty\closure-library\closure\goog** --only_closure_dependencies --generate_export
s --js_output_file compiled\historian-optimized.js --compilation_level SIMPLE_OP
TIMIZATIONS
ERROR - Duplicate input: third_party/closure-library/closure/goog/base.js

1 error(s), 0 warning(s)

Anyone help me? pls~
If someone can help me in fixing it, it would be great.

Could not parse aggregated battery stats.

Please wait, drawing chart...
Error generating historian plot: failed to run command "python scripts/historian.py -c -m -r bugreport_1458786580296.log /tmp/historian973499639": exit status 1 Traceback (most recent call last): File "scripts/historian.py", line 1598, in main() File "scripts/historian.py", line 1347, in main time_delta_s = parse_time(line_time, fmt) + time_offset File "scripts/historian.py", line 107, in parse_time d = match.groupdict() AttributeError: 'NoneType' object has no attribute 'groupdict'

There is no TOP row in the generated HTML

As the photos I see everywhere there is a TOP row that is responsible for showing what application running at the top. But in my generated HTML there is no row that show this info.
screenshot-42

Device: Samsung Galaxy S4
OS version: Kitkat 4.4.2

Is this tool supposed to work on pre-lollipop devices?

stat exec/local_checkin_parse.go: no such file or directory

The battery historian server is working, but the other command-line tools don't work, as shown above.

Are the docs out of date?

I tried running go run cmd/checkin-parse/local_checkin_parse.go --input=$HOME/bugreport.txt but got this output:

command-line-arguments

cmd/checkin-parse/local_checkin_parse.go:49: undefined: batterystats.Checkin
cmd/checkin-parse/local_checkin_parse.go:50: undefined: parse
cmd/checkin-parse/local_checkin_parse.go:55: undefined: parse
cmd/checkin-parse/local_checkin_parse.go:56: undefined: parse
cmd/checkin-parse/local_checkin_parse.go:66: undefined: parse
cmd/checkin-parse/local_checkin_parse.go:71: undefined: parse
cmd/checkin-parse/local_checkin_parse.go:80: undefined: parse
cmd/checkin-parse/local_checkin_parse.go:88: undefined: parse
cmd/checkin-parse/local_checkin_parse.go:91: undefined: parse
cmd/checkin-parse/local_checkin_parse.go:91: too many errors

Ta

Question: Documentation for interpreting chart?

I'm testing the latest developer release of Android 5.0. I'm seeing a large percentage of the battery being used by "Miscellaneous". I've got several days recorded and charts generated from each day. I'm trying to interpret the results and I feel it would be helpful if there was some official documentation to explain how to best use battery-historian. Does this sort of documentation exist?

Exception found in battery dump.

Import bugreport. The battery-historian shows "Exception found in battery dump."

2016/06/06 15:28:53 Trace starting reading uploaded file. 34058646 bytes
2016/06/06 15:28:56 Trace started analyzing file.
2016/06/06 15:28:57 Trace finished generating Historian plot.
2016/06/06 15:28:57 Trace finished processing checkin.
2016/06/06 15:28:57 Trace finished processing summary data.
2016/06/06 15:28:58 Trace finished generating Historian plot and summaries.
2016/06/06 15:28:58 Trace ended analyzing file.
2016/06/06 15:28:58 Trace finished analysisServer processing for: POST

My App Mobile radio (active) time per app rank 0

Hello,I used battery historian to analyze my app's battery usage .I found that the Mobile radio (active) time per app rank 0 in all apps . Anyone can tell me what result this .Thanks in advance.
2015-07-06 10 23 34

newer report version 15 found

On Android 6.0

Warnings:Hide
newer report version 15 found
The underlying format for kwl has 1 additional field(s) that are not captured.

unknown key

On Android 6.0

** Error in 9,h,0,Bl=84,Bs=c,Bh=g,Bp=a,Bt=345,Bv=4195,+r,+w,+Wm,+Wr,+S,+BP,Pss=3,Sb=1,+Ww,+W,+ch,Wss=4,Wsp=compl in +Ww : unknown key Ww. ** Error in 9,h,0,Bl=84,Bs=c,Bh=g,Bp=a,Bt=345,Bv=4195,+r,+w,+Wm,+Wr,+S,+BP,Pss=3,Sb=1,+Ww,+W,+ch,Wss=4,Wsp=compl in +ch : unknown key ch.
** Error in 9,h,17,Est=72 in Est=72 : unknown key Est.
** Error in 9,h,2,Est=75 in Est=75 : unknown key Est.
** Error in 9,h,7,Bp=n,Bt=368,Bv=8424,-BP,-ch,+Ewl=77 in -ch : unknown key ch.
** Error in 9,h,110,-Wm,Est=95 in Est=95 : unknown key Est.
** Error in 9,h,9973,Bt=344,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,724,+Eal=99 in +Eal=99 : unknown key Eal.
** Error in 9,h,1,+Wr,+Etw=100 in +Etw=100 : unknown key Etw.
** Error in 9,h,11,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6,-Eal=99 in -Eal=99 : unknown key Eal.
** Error in 9,h,7011,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1719,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,4082,+r,-Etw=100 in -Etw=100 : unknown key Etw.
** Error in 9,h,2128,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1473,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,21311,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1171,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6018,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1952,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,11266,Bt=326,+r,+Eal=102 in +Eal=102 : unknown key Eal.
** Error in 9,h,8,+Eal=103 in +Eal=103 : unknown key Eal.
** Error in 9,h,9,-Eal=102 in -Eal=102 : unknown key Eal.
** Error in 9,h,4,-Eal=103 in -Eal=103 : unknown key Eal.
** Error in 9,h,152,+Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,30,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,600,+Eal=114 in +Eal=114 : unknown key Eal.
** Error in 9,h,2,-Eal=114 in -Eal=114 : unknown key Eal.
** Error in 9,h,10633,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,31,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,5988,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,2146,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,455,+Eal=117 in +Eal=117 : unknown key Eal.
** Error in 9,h,1,+Eal=118 in +Eal=118 : unknown key Eal.
** Error in 9,h,2,+Eal=102 in +Eal=102 : unknown key Eal.
** Error in 9,h,0,+Eal=119 in +Eal=119 : unknown key Eal.
** Error in 9,h,2,-Eal=117 in -Eal=117 : unknown key Eal.
** Error in 9,h,1,-Eal=118 in -Eal=118 : unknown key Eal.
** Error in 9,h,8,-Eal=102 in -Eal=102 : unknown key Eal.
** Error in 9,h,21,-Eal=119 in -Eal=119 : unknown key Eal.
** Error in 9,h,4038,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,721,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,5798,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,949,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6305,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,757,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6541,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,25,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,13217,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,211,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6323,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1068,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6041,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,2220,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,1,+Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,14432,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,0,Dcpu=12230:45830 in Dcpu=12230:45830 : unknown key Dcpu.
** Error in 9,h,0,Dpst=13580,44740,8430,0,1170,78310 in Dpst=13580 : unknown key Dpst. ** Error in 9,h,0,Dpst=13580,44740,8430,0,1170,78310 in 44740 : unknown key 44740. ** Error in 9,h,0,Dpst=13580,44740,8430,0,1170,78310 in 8430 : unknown key 8430. ** Error in 9,h,0,Dpst=13580,44740,8430,0,1170,78310 in 0 : unknown key 0. ** Error in 9,h,0,Dpst=13580,44740,8430,0,1170,78310 in 1170 : unknown key 1170. ** Error in 9,h,0,Dpst=13580,44740,8430,0,1170,78310 in 78310 : unknown key 78310.
** Error in 9,h,17,-r,Est=127 in Est=127 : unknown key Est.
** Error in 9,h,1080,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6588,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,691,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,8745,+r,+Eal=102 in +Eal=102 : unknown key Eal.
** Error in 9,h,4,+Eal=128 in +Eal=128 : unknown key Eal.
** Error in 9,h,1,+Etw=129 in +Etw=129 : unknown key Etw.
** Error in 9,h,13,-Eal=102 in -Eal=102 : unknown key Eal.
** Error in 9,h,5,-Eal=128 in -Eal=128 : unknown key Eal.
** Error in 9,h,2,+Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,6021,+r,-Wr,-Etw=129 in -Etw=129 : unknown key Etw.
** Error in 9,h,44,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1862,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6998,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,426,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,944,+r,+Eal=132 in +Eal=132 : unknown key Eal.
** Error in 9,h,1,-Eal=132 in -Eal=132 : unknown key Eal.
** Error in 9,h,2,+Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,12659,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1213,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,1007,+r,+Eal=133 in +Eal=133 : unknown key Eal.
** Error in 9,h,5,+Etw=134 in +Etw=134 : unknown key Etw.
** Error in 9,h,22,-Eal=133 in -Eal=133 : unknown key Eal.
** Error in 9,h,8861,+r,+Eal=102 in +Eal=102 : unknown key Eal.
** Error in 9,h,9,+Eal=119 in +Eal=119 : unknown key Eal.
** Error in 9,h,1,-Eal=102 in -Eal=102 : unknown key Eal.
** Error in 9,h,42,-Eal=119 in -Eal=119 : unknown key Eal.
** Error in 9,h,534,-Etw=134 in -Etw=134 : unknown key Etw.
** Error in 9,h,2565,-Ws,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,5530,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,19139,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,404,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6249,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1606,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,5784,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1320,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,7110,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,544,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6065,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1527,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,5933,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1411,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,24943,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,720,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6429,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1913,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,6054,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1218,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,20449,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,7376,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,5879,+r,-Wr,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,1471,+r,+Wr,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,0,Dcpu=4130:61400 in Dcpu=4130:61400 : unknown key Dcpu.
** Error in 9,h,0,Dpst=4750,58490,11100,20,690,64680 in Dpst=4750 : unknown key Dpst. ** Error in 9,h,0,Dpst=4750,58490,11100,20,690,64680 in 58490 : unknown key 58490. ** Error in 9,h,0,Dpst=4750,58490,11100,20,690,64680 in 11100 : unknown key 11100. ** Error in 9,h,0,Dpst=4750,58490,11100,20,690,64680 in 20 : unknown key 20. ** Error in 9,h,0,Dpst=4750,58490,11100,20,690,64680 in 690 : unknown key 690. ** Error in 9,h,0,Dpst=4750,58490,11100,20,690,64680 in 64680 : unknown key 64680.
** Error in 9,h,6,-Wr,Est=127 in Est=127 : unknown key Est.
** Error in 9,h,56,-r,Est=98 in Est=98 : unknown key Est.
** Error in 9,h,17,Est=101 in Est=101 : unknown key Est.
** Error in 9,h,0,+Etw=136 in +Etw=136 : unknown key Etw.
** Error in 9,h,400,+Eal=102 in +Eal=102 : unknown key Eal.
** Error in 9,h,0,+Eal=119 in +Eal=119 : unknown key Eal.
** Error in 9,h,35,Esw=138 in Es : unknown key Es.
** Error in 9,h,4,-Eal=102 in -Eal=102 : unknown key Eal.
** Error in 9,h,1,+S,+Eal=140 in +Eal=140 : unknown key Eal.
** Error in 9,h,27,+Eal=141 in +Eal=141 : unknown key Eal.
** Error in 9,h,0,+Eal=142 in +Eal=142 : unknown key Eal.
** Error in 9,h,0,+Eal=143 in +Eal=143 : unknown key Eal.
** Error in 9,h,1,+Eal=144 in +Eal=144 : unknown key Eal.
** Error in 9,h,5,Sb=1,-Eal=140 in -Eal=140 : unknown key Eal.
** Error in 9,h,11,-Eal=119 in -Eal=119 : unknown key Eal.
** Error in 9,h,15,-Eal=142 in -Eal=142 : unknown key Eal.
** Error in 9,h,7,-Eal=143 in -Eal=143 : unknown key Eal.
** Error in 9,h,1,-Eal=144 in -Eal=144 : unknown key Eal.
** Error in 9,h,78,-Eal=141 in -Eal=141 : unknown key Eal.
** Error in 9,h,426,-Ws,Est=95 in Est=95 : unknown key Est.
** Error in 9,h,86,Pss=1,-Etw=136 in -Etw=136 : unknown key Etw.
** Error in 9,h,5410,+Eal=141 in +Eal=141 : unknown key Eal.
** Error in 9,h,99,-Eal=141 in -Eal=141 : unknown key Eal.
** Error in 9,h,90,-Wm,Est=95 in Est=95 : unknown key Est.

Request: make it easy to use this tool

The installation and running process takes so many steps, including installing of multiple apps.

Please make it easier to use. To me, it doesn't make sense to have Java+python+go installed, and even then, run the whole thing in the web browser...

Maybe make it a part of the IDE ?

Problem with historian.py in Go webapplication

After getting the go system to work and compiled all the stuff i got an error after submitting an txt file to the webapp (see screenshot)

Error generating historian plot: fork/exec ./historian.py: %1 ist keine zulässige Win32-Anwendung.

I think there is a path failure to python but if i start historian.py in an command window everything works well.

Also the

unsupported bug report version
unable to find device SDK version

failure are confusing. Did i miss something to install?

Stats are generated via

adb shell dumpsys batterystats > output.txt

Screenshot1

Working on Windows 7 x64

Binary distribution

It's relatively trivial to set up Travis CI for this project so I went ahead and did it. There are now binaries available on that repo.

Could we set this up on the main repo? It'd make this tool much more accessible.

problem with loading charts, app stats

when i choose an application nothing will happen looks like something is wrong and also historian don't generate any log.
1
and also when I switch to "Historian (legacy)" and choose redraw nothing will happen again.

2
and this is what i get using fire fox web console.
3

TypeError: historian.render is not a function
ReferenceError: drawChart is not defined
ReferenceError: appStats is not defined

battery-historian can't parse bugreport after summit bugreport.txt

It display as follow in brower:
{"UploadResponse":[{"sdkVersion":23,"historianV2Csv":"metric,type,start_time,end_time,value,opt\nCharging status,string,1463790151962,1463790152025,f,\nWifi signal strength,string,1463790151962,1463790154975,good,\nMobile signal strength,string,1463790151962,1463790158003,poor,\nWifi signal strength,string,1463790154975,1463790161014,moderate,\nWifi signal strength,string,1463790161014,1463790164028,good,\nWifi radio,bool,1463790151962,1463790181999,true,\nWifi supplicant,string,1463790151962,1463790181999,compl,\nNetwork connectivity,service,1463790151962,1463790181999,TYPE_WIFI:"CONNECTED",\nWifi supplicant,string,1463790181999,1463790182598,dsc,\nWifi supplicant,string,1463790182598,1463790182976,scan,\nSyncManager,service,1463790182783,1463790182976,"com.qihoo.appstore.account.syncprovider/com.qihoo.appstore.account/360手机助手",10112\nWifi supplicant,string,1463790182976,1463790183650,asced,\nWifi supplicant,string,1463790183650,1463790183669,4-way,\nWifi supplicant,string,1463790183669,1463790183795,group,\nScreen,bool,1463790151962,1463790191062,true,unknown screen on reason\nTop app,service,1463790151962,1463790191062,"com.netease.newsreader.activity",10118\nPartial wakelock,service,1463790151962,1463790194807,unknown-wakelock-holder,\nPartial wakelock,service,1463790195517,1463790196204,"walarm:com.android.internal.policy.impl.PhoneWindowManager.DELAYED_KEYGUARD",\nMobile network type,string,1463790181999,1463790197439,lte,\nNetwork connectivity,service,1463790182598,1463790197439,TYPE_MOBILE:"CONNECTED",\nPartial wakelock,service,1463790197439,1463790197680,"RILJ",\nPartial wakelock,service,1463790198370,1463790198387,"RILJ",\nPartial

Abnormal show ,When I submit

{"UploadResponse":[{"sdkVersion":23,"historianV2Csv":"metric,type,start_time,end_time,value,opt\nWakelock_in,service,1468313701018,1468313701093,"RILJ",1001\nWakelock_in,service,1468313700986,1468313702488,"bluetooth_timer",1002\nCharging status,string,1468313700966,1468313703980,c,\nWakelock_in,service,1468313703980,1468313704030,"Wakeful StateMachine: GeofencerStateMachine",10014\nWakelock_in,service,1468313704072,1468313704085,"RILJ",1001\nPlug,string,1468313700966,1468313704098,u,\nTemperature,int,1468313700966,1468313704098,338,\nVoltage,int,1468313700966,1468313704098,3814,\nPlugged,bool,1468313700966,1468313704098,true,\nWakelock_in,service,1468313704041,1468313705542,"bluetooth_timer",1002\nAlarm,service,1468313706705,1468313706709,"walarm:com.google.android.googlequicksearchbox/com.google.android.apps.gsa.tasks.VelvetBackgroundTasksIntentService",10034\nWakelock_in,service,1468313706702,1468313706710,"walarm:WifiConnectivityManager Schedule Periodic Scan Timer",1000\nAlarm,service,1468313706703,1468313706711,"walarm:com.google.android.location.ALARM_WAKEUP_LOCATOR",10093\nAlarm,service,1468313706702,1468313706713,"walarm:WifiConnectivityManager Schedule Periodic Scan Timer",1000\nWakelock_in,service,1468313706710,1468313706714,"alarm",1000\nActive process,service,1468313700966,1468313706764,"com.google.android.gms.unstable",10014\nWifi full lock,bool,1468313706707,1468313706793,true,\nWakelock_in,service,1468313706720,1468313706793,"RILJ",1001\nWifi scan,bool,1468313706720,1468313706799,true,\nWakelock_in,service,1468313706707,1468313706799,"NlpWakeLock",10093\nWakelock_in,service,1468313707635,1468313707641,"NlpWakeLock",10034\nWakelock_in,service,1468313707642,1468313707646,"NlpWakeLock",10093\nWakelock_in,service,1468313707648,1468313707651,"NlpWakeLock",10034\nWakelock_in,service,1468313707655,1468313707658,"LocationManagerService",1000\nWakelock_in,service,1468313707656,1468313707658,"LocationManagerService",10014\nWakelock_in,service,1468313707642,1468313707667,"GCoreFlp",10034\nWifi scan,bool,1468313707635,1468313707668,true,\nWakelock_in,service,1468313707644,1468313707668,"GCoreFlp",10014\nCoulomb charge,int,1468313700966,1468313714645,31753,\nAlarm,service,1468313726722,1468313726727,"walarm:WifiConnectivityManager Schedule Periodic Scan Timer",1000\nAlarm,service,1468313726713,1468313726738,"walarm:com.google.android.location.ALARM_WAKEUP_LOCATOR",10093\nWakelock_in,service,1468313726720,1468313726738,"walarm:com.google.android.location.ALARM_WAKEUP_LOCATOR",10093\nWifi full lock,bool,1468313726727,1468313726838,true,\nWakelock_in,service,1468313726760,1468313726838,"RILJ",1001\nWakelock_in,service,1468313726726,1468313726852,"NlpWakeLock",10093\nJobScheduler,service,1468313706756,1468313727035,"DownloadManager:com.android.providers.downloads",10034\nWifi scan,bool,1468313726760,1468313727035,true,\nWakelock_in,service,1468313706759,1468313727035,"job/DownloadManager:com.android.providers.downloads",10034\nWifi scan,bool,1468313727734,1468313728702,true,\nWakelock_in,service,1468313728702,1468313728749,"NlpWakeLock",10034\nWakelock_in,service,1468313728750,1468313728756,"NlpWakeLock",10093\nWakelock_in,service,1468313728758,1468313728765,"NlpWakeLock",10034\nWakelock_in,service,1468313728752,1468313728779,"GCoreFlp",10034\nWakelock_in,service,1468313728774,1468313728779,"LocationManagerService",1000\nWakelock_in,service,1468313728754,1468313728780,"GCoreFlp",10014\nWakelock_in,service,1468313728777,1468313728781,"LocationManagerService",10014\nCoulomb charge,int,1468313714645,1468313728782,31752,\nWakelock_in,service,1468313728771,1468313728782,"LocationManagerService",10093\nAlarm,service,1468313739735,1468313740670,"walarm:com.sina.heartbeat.action.1004",10095\nWakelock_in,service,1468313740646,1468313740670,"walarm:com.sina.heartbeat.action.1004",10095\nAlarm,service,1468313746731,1468313746744,"walarm:WifiConnectivityManager Schedule Periodic Scan Timer",1000\nWakelock_in,service,1468313746733,1468313746745,"walarm:WifiConnectivityManager Schedule Periodic Scan Timer",1000\nAlarm,service,1468313746735,1468313746767,"walarm:com.google.android.location.ALARM_WAKEUP_LOCATOR",10093\nWakelock_in,service,1468313746745,1468313746768,"alarm",10093\nWifi full lock,bool,1468313746748,1468313746862,true,\nWakelock_in,service,1468313746786,1468313746862,"RILJ",1001\nWifi scan,bool,1468313746768,1468313746879,true,\nWakelock_in,service,1468313746748,1468313746879,"NlpWakeLock",10093\nWifi scan,bool,1468313747676,1468313748691,true,\nWakelock_in,service,1468313748691,1468313748704,"NlpWakeLock",10034\nWakelock_in,service,1468313748704,1468313748706,"NlpWakeLock",10093\nWakelock_in,service,1468313748707,1468313748711,"NlpWakeLock",10034\nWakelock_in,service,1468313748716,1468313748719,"LocationManagerService",1000\nWakelock_in,service,1468313748717,1468313748719,"LocationManagerService",10014\nWakelock_in,service,1468313748705,1468313748721,"GCoreFlp",10034\nWakelock_in,service,1468313748706,1468313748722,"GCoreFlp",10014\nCoulomb charge,int,1468313728782,1468313749760,31751,\nWifi signal strength,string,1468313700966,1468313754775,good,\nAlarm,service,1468313759774,1468313760123,"alarm:android.intent.action.TIME_TICK",1000\nWakelock_in,service,1468313760002,1468313760123,"alarm:android.intent.action.TIME_TICK",1000\nCoulomb charge,int,1468313749760,1468313764811,31750,\nAlarm,service,1468313768676,1468313768679,"walarm:JobScheduler.delay",1000\nWakelock_in,service,1468313768673,1468313768680,"walarm:WifiConnectivityManager Schedule Periodic Scan Timer",1000\nAlarm,service,1468313768671,1468313768681,"walarm:WifiConnectivityManager Schedule Periodic Scan Timer",1000\nWakelock_in,service,1468313768680,1468313768682,"alarm",1000\nAlarm,service,1468313768674,1468313768716,"walarm:com.google.android.location.ALARM_WAKEUP_LOCATOR",10093\nWakelock_in,service,1468313768682,1468313768717,"alarm",10093\nWifi full lock,bool,1468313768684,1468313768797,true,\nWakelock_in,service,1468313768720,1468313768797,"RILJ",1001\nWifi scan,bool,1468313768684,1468313768806,true,\nWakelock_in,service,1468313768684,1468313768806,"NlpWakeLock",10093\nVoltage,int,1468313704098,1468313769821,3745,\nWifi scan,bool,1468313769625,1468313769821,true,\nWifi signal strength,string,1468313754775,1468313769821,moderate,\nWifi signal strength,string,1468313769821,1468313773636,good,\nVoltage,int,1468313769821,1468313774841,3716,\nCoulomb charge,int,1468313764811,1468313779747,31749,\nWifi signal strength,string,1468313773636,1468313779747,moderate,\nVoltage,int,1468313774841,1468313779875,3740,\nVoltage,int,1468313779875,1468313784871,3719,\nAlarm,service,1468313788688,1468313788698,"walarm:WifiConnectivityManager Schedule Periodic Scan Timer",1000\nWakelock_in,service,1468313788689,1468313788698,"walarm:WifiConnectivityManager Schedule Periodic Scan Timer",1000\nAlarm,service,1468313788690,1468313788711,"walarm:com.google.android.location.ALARM_WAKEUP_LOCATOR",10093\nWakelock_in,service,1468313788698,1468313788711,"alarm",10093\nWifi full lock,bool,1468313788698,1468313788812,true,\nWakelock_in,service,1468313788729,1468313788812,"RILJ",1001\nWakelock_in,service,1468313769821,1468313788826,"NlpWakeLock",10093\nJobScheduler,service,1468313768715,1468313789086,"DownloadManager:com.android.providers.downloads",10034\nWifi scan,bool,1468313788711,1468313789086,true,\nWakelock_in,service,1468313768723,1468313789086,"job/DownloadManager:com.android.providers.downloads",10034\nVoltage,int,1468313784871,1468313789889,3743,\nWakelock_in,service,1468313790641,1468313790648,"NlpWakeLock",10034\nWakelock_in,service,1468313790651,1468313790657,"NlpWakeLock",10093\nWakelock_in,service,1468313789889,1468313790666,"NlpWakeLock",10014\nWakelock_in,service,1468313790663,1468313790667,"NlpWakeLock",10034\nWakelock_in,service,1468313790669,1468313790670,"GCoreFlp",10034\nWifi scan,bool,1468313789733,1468313790672,true,\nWakelock_in,service,1468313790671,1468313790672,"GCoreFlp",10014\nVoltage,int,1468313789889,1468313799928,3718,\nCoulomb

......
......

Error parsing bugreport, no data showed at all

Hey,

At a quick look, seems that Battery Historian didn't like my bugreport. I've deployed the app correctly, take the bugreport with adb bugreport > output.txt, and the error I'm showing is the following:

Parsing Errors: 
error parsing kwl: strconv.ParseFloat: parsing "qcrypto1": invalid syntax

Warnings:
The underlying format for kwl has 1 additional field(s) that are not captured.

My computer is a Mac Mini with Yosemite, and Go freshly installed, with path variables correctly setted. My Android device is LG G2 (D802) with Lollipop 5.0 stock and rooted.

Here are few lines of my bugreport, think that error comes for the kwl lines.

9,0,l,wsgc,4,5,46,115,71
9,0,l,bst,0,0,0,0
9,0,l,bsc,0,0,0,0
9,0,l,dc,38,41,17,24
9,0,l,kwl,ipc00000078_sensors.qcom,0,22
9,0,l,kwl,ipc000000d1_sensors.qcom,0,22
9,0,l,kwl,ipc0000006a_sensors.qcom,0,22
9,0,l,kwl,ipc00000087_sensors.qcom,0,0
9,0,l,kwl,ipc0000001b_sensors.qcom,0,0
9,0,l,kwl,ipc00000006_thermal-engine,0,0
9,0,l,kwl,ipc00000001_rfs_access,0,0
9,0,l,kwl,ipc00000025_sensors.qcom,0,0
9,0,l,kwl,ipc0000009b_thermal-engine,0,0
9,0,l,kwl,ipc00000076_sensors.qcom,0,22
9,0,l,kwl,ipc00000030_sensors.qcom,0,22
9,0,l,kwl,smdcntl4    ,0,0
9,0,l,kwl,sns_async_ev_wakelock,-9326,72
9,0,l,kwl,ipc0000009c_thermal-engine,0,22

FYI, I have a warning installing the battery historian project. As I have no Go background, I have no idea at all. Seems that it isn't compiling, I've tried twice with no luck.

Mac-mini:battery-historian user$ go get -u github.com/google/battery-historian
package github.com/google/battery-historian: no buildable Go source files in /Users/<--->/gocode/src/github.com/google/battery-historian

Thanks in advance

Battery Historian - Setup Issue

When i run following command on my windows machine (OS Windows 10) given in setup.

// Compile Javascript files using the Closure compiler
$ bash setup.sh

It gives the following result and i am unable to do a proper setup for battery historian.
C:\Users\USERNAME\go_work\src\github.com\google\battery-historian>bash setup.sh
setup.sh: line 58: java: command not found

I tried the mentioned line command into command prompt directly but didn't work either.

Command given on line 58 is:
java -jar third_party/closure-compiler/compiler.jar --closure_entry_point historian.Historian
--js js/.js
--js third_party/closure-library/closure/goog/base.js
--js third_party/closure-library/closure/goog/
*
--only_closure_dependencies
--generate_exports
--js_output_file compiled/historian-optimized.js
--compilation_level SIMPLE_OPTIMIZATIONS

If someone can help me in fixing it, it would be great.
Need this tool in urgent.

Failed to run: go run setup.go

I get following messages:

 ~/works/go/src/github.com/google/battery-historian$ go run setup.go
# github.com/golang/protobuf/proto
../../golang/protobuf/proto/text.go:39: imported and not used: "encoding"
../../golang/protobuf/proto/text.go:538: undefined: encoding
../../golang/protobuf/proto/text.go:800: undefined: encoding
../../golang/protobuf/proto/text_parser.go:38: imported and not used: "encoding"
../../golang/protobuf/proto/text_parser.go:861: undefined: encoding

The operating system is Ubuntu 12.04. I have tried go1.6 and go1.5.3. Both are the same. And it works fine on my mac.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.