Coder Social home page Coder Social logo

glimmeryang / blockcanary Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markzhai/androidperformancemonitor

0.0 2.0 0.0 451 KB

A ui-block detection library for Android.

Home Page: http://blog.zhaiyifan.cn/2016/01/16/BlockCanaryTransparentPerformanceMonitor/

License: Apache License 2.0

Java 100.00%

blockcanary's Introduction

English 日本語(まだなんです)

BlockCanary Maven Central

BlockCanary是一个Android平台的一个非侵入式的性能监控组件,应用只需要实现一个抽象类,提供一些该组件需要的上下文环境,就可以在平时使用应用的时候检测主线程上的各种卡慢问题,并通过组件提供的各种信息分析出原因并进行修复。

功能及原理

BlockCanary — 轻松找出Android App界面卡顿元凶.

使用方法

在Application中:

public class DemoApplication extends Application {
    @Override
    public void onCreate() {
        ...
        // 在主进程初始化调用哈
        BlockCanary.install(this, new AppBlockCanaryContext()).start();
    }
}

实现自己的监控上下文:

public class AppBlockCanaryContext extends BlockCanaryContext {
    // 实现各种上下文,包括应用标示符,用户uid,网络类型,卡慢判断阙值,Log保存位置等
}

引入

dependencies {
    // 如果希望在release包也开启监控可以直接用compile
    // compile 'com.github.moduth:blockcanary:1.0.1'

    debugCompile 'com.github.moduth:blockcanary:1.0.1'
    releaseCompile 'com.github.moduth:blockcanary-no-op:1.0.1'
}

Demo工程

请参考本项目下的demo module,点击三个按钮会触发对应的耗时事件,消息栏则会弹出block的notification,点击可以进去查看详细信息。

Block detail Block list

blockcanary's People

Contributors

markzhai avatar nimengbo avatar android-cjj avatar

Watchers

James Cloos avatar  avatar

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.