zoukankan      html  css  js  c++  java
  • android TraceView (图形化性能测试工具)使用入门笔记

    创建你TraceView

    1.在开始使用TraceView你要注意:

      你的设备和模拟器必须设置SD card 和 你的程序拥有对SD card 具有读写操作的权限(

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />)

    2.在你的程序中使用TraceView

     // 开始跟踪然后自动保存到 "/sdcard/test.trace"
        Debug.startMethodTracing("test");
        // ...
        // 停止跟踪
        Debug.stopMethodTracing();

    使用traceView就只需要这两个方法了…

    举个例子我们可以在:

    //onCreate方法中调用
    onCreate(){
    Debug.startMethodTracing("test");
    }
    //.............
    
    //onPause 方法中结束
    onPause{
    Debug.stopMethodTracing();
    
    }

    当然,你Debug的位置你可以随便设置,只要符合要求就行

    然后,结束调试好,你会在eclipse 中的file explorer 中看到生成的文件

    image

    选择

    image

    把我们要的trace文件拿出来

    image

    这里注意,文件路径要大全,不然,无法显示…

    时间片面板(Timeline panel)

    image

    分析面板(Profile panel)

    image

    以下是翻译

    英语 中文
    Incl 调用方法占用时间百分比
    Inclusive 调用方法时间(ms)(包括了所有方法的调用)
    Excl 执行方法占用时间百分比
    Exclusive 执行方法占用时间(ms)(不包括子方法的调用)
    Calls+Recur Calls/Total 调用和重复调用的次数
    Time/Call 总的时间(ms)

    文档中提及一个dmtracdedump 的工具 要预装Graphviz ,而且,还要写pytho脚本才能用…

    image

    效果就是这样,有兴趣的可以参考:

    http://blog.csdn.net/zjujoe/article/details/6080738

  • 相关阅读:
    js 图表处理之Echar
    web.py url传参及获取
    算法理论基础
    Django------model基础
    python 数据分析----matplotlib
    python 数据分析----pandas
    python 数据分析----numpy
    ipythons 使用攻略
    Django----Request对象&Response对象
    Django---ModelForm详解
  • 原文地址:https://www.cnblogs.com/youxilua/p/2192305.html
Copyright © 2011-2022 走看看