Comments (7)
/**
* 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.
/**
* 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.
谢谢谢谢,其实问完问题后就找到了那个文件,之前没有仔细看代码。。。。。。
还有一个问题,代码里边有好多 mRandom.nextInt(Integer.MAX_VALUE); 产生随机数,这个我没看懂,不知道用来干嘛的。。。本人android菜鸟一枚 原谅哈
from blockcanaryex.
单纯模拟计算耗时操作。
from blockcanaryex.
感谢up主分享这些好的东西,还有一个小小的问题:
[93%] Fragment.onCreateView(LayoutInflater,ViewGroup,Bundle) costRealTime:333ms costThreadTime:238ms
以上是我的结果之一,我想知道 [93%] 代表什么,costRealTime和costThreadTime有什么区别吗?再次感谢
from blockcanaryex.
运行了你的demo,发现每个方法耗时结果点击后会有更详细的信息,这个在/sdcard/blockcanaryex//下的文件里似乎没有,请问如果我想得到这些更详细的信息,打印blockInfo可以吗
from blockcanaryex.
文件里面已经是最全的信息了,界面里面的所有信息都来自文件
from blockcanaryex.
Related Issues (20)
- After upgrade Android gradle plugin to 3.0.0, apply plugin blockcanaryex failed. HOT 5
- 貌似插件里的代码有错误! HOT 1
- 没有提示代码行数 HOT 1
- 集成后报空指针异常 HOT 1
- 使用MultiDex.install(this)后, 编译通过, 但项目运行不起来 HOT 5
- include的逻辑有问题!!!!!!! HOT 1
- 通知notification显示的卡顿次数数目不对
- Hook Trace部分的代码,在vivo X6s手机上crash HOT 1
- Not compat 'com.android.tools.build:gradle:3.1.0-alpha02'.
- 编译不通过 java.io.IOException: Could not delete path......\transforms\desugar\debug\10.jar'. HOT 2
- 编译不通过,org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'BlockCanaryExPlugin'. HOT 1
- Could not initialize class com.letv.sarrsdesktop.blockcanaryex.BlockCanaryExPlugin HOT 9
- android studio 3.0中在app的build.gradle中引入apply plugin: 'blockcanaryex'会报错 HOT 4
- Is it possible support android 27 and android 28?
- Looper.logging 被 TraceEvent 覆盖,导致失效
- gc-event:null,heavy-methods:null ,too-heavy-methods:null
- Could not initialize class com.letv.sarrsdesktop.blockcanaryex.BlockCanaryExPlugin Open File
- 为什么不维护了呢?枉费大家对你的信任。有如下问题:1、notification不通知2、不显示耗时的方法堆栈 HOT 1
- Failed to apply plugin [id 'blockcanaryex'] HOT 2
- gradle4.1.3已经集成不了了
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blockcanaryex.