make performance bottleneck detection easily when app blocked
make performance bottleneck detection easily when app blocked
a library for android which can help you to find heavy methods in your code when your app blocked, base on BlockCanary.
root build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0' //version must >= 1.5.0
classpath 'com.letv.sarrsdesktop:BlockCanaryExPlugin:0.9.9.5'
}
}model build.gradle
apply plugin: 'blockcanaryex'debugCompile 'com.letv.sarrsdesktop:BlockCanaryExJRT:0.9.9.4'
releaseCompile 'com.letv.sarrsdesktop:BlockCanaryExJRTNoOp:0.9.9.4'
testCompile 'com.letv.sarrsdesktop:BlockCanaryExJRTNoOp:0.9.9.4'init BlockCanaryEx before other method when your application attachBaseContext
public class TestApplication extends Application {
@Override
public void attachBaseContext(Context context) {
super.attachBaseContext(context);
boolean isInSamplerProcess = BlockCanaryEx.isInSamplerProcess(this);
if(!isInSamplerProcess) {
BlockCanaryEx.install(new Config(this));
}
if(!isInSamplerProcess) {
//your code start here
}
}
}done, now BlockCanaryEx be enabled when you app in debug mode.
BlockCanaryEx do method sample by inject MethodSampler into your code when compile time, the scope to inject MethodSampler is the src of your project and subProject by default. projectLocalDep, subProjectLocalDep, externalLibraries is ignored. If you want to change the scope to watch more method performance, you can do the config in gradle.
…you also can override more Config method to customize BlockCanaryEx runtime
… Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.No open issues yet, or sync has not completed.