Giter VIP home page Giter VIP logo

android-performance's Introduction

android-performance

抓取android手机cpu、内存、流量信息,使用jschart生成html报表.

使用shell脚本抓取android手机信息,脚本路径src/main/resources
##cpu##

adb shell top -n 1| awk '{print $3" "$10}' >> cpu.dat

##mem##

adb shell ps | awk '{print $5" "$9}' >> mem.dat

##流量##

  • android sdk level 大于16

      adb shell cat /proc/uid_stat/$uid/tcp_rcv >> $uid"_recv.dat"
      adb shell cat /proc/uid_stat/$uid/tcp_snd >> $uid"_snd.dat"
    
  • android sdk level 小于16

      adb shell cat /proc/$pid/net/dev | grep wlan | awk '{print $2" "$10}' >> $pid"_net.dat"
    

过程就是通过循环调用上面的命令,将结果写到dat文件,然后再解析dat文件,最后使用jscharts绘出走势图。

##使用方法##

  1. 执行mvn clean,清除上次数据
  2. 执行get-android-info.sh,开始收集数据
  3. 一段时间后执行kill-scripts.sh,结束收集
  4. 执行mvn test解析dat,生成html报表。报表在target/android-info下。

android-performance's People

Contributors

yeetrack avatar

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.