找回密码
 立即注册
查看: 436|回复: 0

Android 性能优化(1)- 电量优化 battery historian搭建

[复制链接]
发表于 2022-3-31 20:31 | 显示全部楼层 |阅读模式
本文主要分析了Android平板电量数据采集以及如何使用Battery Historian进行电量问题分析
1.battery historian平台搭建

1)安装battery historian最简单是通过Docker进行安装,本文主要介绍自行编译源码实现,主要参考 https://github.com/google/battery-historian/

2)安装Go语言环境

3)安装python环境


4)安装git

5)拉取 battery-historian 源代码

拉取一下电量分析源代码:go get -d -u github.com/google/battery-historian 成功之后出现在:src/github.com/google/battery-historian

需要protobuf-go这个版本:https://github.com/protocolbuffers/protobuf-go/ 自行修改下目录 src/google.golang.org/protobuf


6)进行编译   

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

# Compile Javascript files using the Closure compiler

$ go run setup.go

7) third_party下有3个git仓库,从下边进行获取

closure-library : https://github.com/google/closure-library/releases/tag/v20161201

  flot-axislabels : git上搜索一下或是gitee上查一个也行

  closure-compiler:同上

8)编译项目

        cd $GOPATH/src/github.com/google/battery-historian(注意cd到目录即可,不然会出现一点问题)

    go run cmd/battery-historian/battery-historian.go [--port <default:9999>]

9) 访问http://localhost:9999

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2025-5-9 10:27 , Processed in 0.139341 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表