Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

BlockCanaryEx

> 数据库
Open source

make performance bottleneck detection easily when app blocked

2.2K stars0 likes0 views
WebsiteGitHub

About

make performance bottleneck detection easily when app blocked

中文文档

BlockCanaryEx

a library for android which can help you to find heavy methods in your code when your app blocked, base on BlockCanary.

What's the difference between BlockCanaryEx and BlockCanary

  • BlockCanaryEx java runtime code are modified form BlockCanary, ui and features are mostly same;
  • BlockCanaryEx add MethodSampler, knows every method's execute info (like cost-time, called-times...) when blocked;
  • BlockCanaryEx focus on the method which cost most of time when your app blocked, and display it directly to developer;
  • BlockCanaryEx add gc sampler,we can know whether and when gc happened during we blocked.
  • add view performance sampler, we can know the detail about view measure, layout, draw during we blocked.

What's we target

Download

root build.gradle

groovy
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

groovy
apply plugin: 'blockcanaryex'
groovy
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'

Basic Usage

init BlockCanaryEx before other method when your application attachBaseContext

java
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.

Advance Usage

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

…

License

 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.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaandroidblockcanaryexfindblockperformance

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库