GithubHelp home page GithubHelp logo

Comments (7)

seiginonakama avatar seiginonakama commented on September 14, 2024
    /**
     * Path to save log, like "/blockcanary/", will save to sdcard if can. if we can't save log to sdcard (eg: no permission),
     * else we will try to save to "${context.getExternalFilesDir("BlockCanaryEx")}${provideLogPath()}", if we failed too,
     * we will save to "${context.getFilesDir()${provideLogPath()}"}"
     *
     * Note: running in none ui thread
     *
     * @return path of log files
     */
    public String provideLogPath() {
        return "/blockcanaryex/" + getContext().getPackageName() + "/";
    }

BlockCanary会自动把日志写到存储里面。
默认是/sdcard/blockcanaryex/<packageName>/。如果没有写权限,会写到/sdcard/Android/data/<packageName>/files/BlockCanaryEx/blockcanaryex。

from blockcanaryex.

seiginonakama avatar seiginonakama commented on September 14, 2024
              /**
               * Block listener, developer may provide their own actions
               *
               * @param blockInfo {@link BlockInfo}
               */
              @Override
              public void onBlock(BlockInfo blockInfo) {
              }

如果没有ui界面,你可以复写Config的onBlock方法监听卡顿事件,把blockInfo打印到logcat也可以。

from blockcanaryex.

dengzhao7053 avatar dengzhao7053 commented on September 14, 2024

谢谢谢谢,其实问完问题后就找到了那个文件,之前没有仔细看代码。。。。。。

还有一个问题,代码里边有好多 mRandom.nextInt(Integer.MAX_VALUE); 产生随机数,这个我没看懂,不知道用来干嘛的。。。本人android菜鸟一枚 原谅哈

from blockcanaryex.

seiginonakama avatar seiginonakama commented on September 14, 2024

单纯模拟计算耗时操作。

from blockcanaryex.

dengzhao7053 avatar dengzhao7053 commented on September 14, 2024

感谢up主分享这些好的东西,还有一个小小的问题:
[93%] Fragment.onCreateView(LayoutInflater,ViewGroup,Bundle) costRealTime:333ms costThreadTime:238ms
以上是我的结果之一,我想知道 [93%] 代表什么,costRealTime和costThreadTime有什么区别吗?再次感谢

from blockcanaryex.

dengzhao7053 avatar dengzhao7053 commented on September 14, 2024

运行了你的demo,发现每个方法耗时结果点击后会有更详细的信息,这个在/sdcard/blockcanaryex//下的文件里似乎没有,请问如果我想得到这些更详细的信息,打印blockInfo可以吗

from blockcanaryex.

seiginonakama avatar seiginonakama commented on September 14, 2024

文件里面已经是最全的信息了,界面里面的所有信息都来自文件

from blockcanaryex.

Related Issues (20)

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.